Dev Tips: DevTools: Refactor your styles with CSS Overview

Dev Tips

 

DevTools: Refactor your stylesheets with CSS Overview


Introduction

The CSS Overview Panel provides interesting information on your CSS. You can view high-level CSS metrics which are especially useful when refactoring.
 

How to use this feature

Enable this feature:

  1. Enable CSS Overview from the DevTools Experiments pane (Cmd + Shift + P > Show Experiments)
  2. Select Show CSS Overview from the DevTools Command Menu (Cmd + Shift + P)


In the CSS Overview Panel, you can navigate to different sections:

  • Overview Summary - Interesting metrics on your CSS, such as number of elements, stylesheets, class vs ID selectors, complex selectors and more.
  • Colors - A visual preview of background colors, text colors, fill colors and border colors. The colors themselves are clickable, so you can view exactly which element(s) use such color.
  • Font info - Metrics on font usage and how often they appear within stylesheets. Includes font weight and line height metrics. Font metrics can be selected to reveal affected elements.
  • Unused declarations - Unused CSS declarations, which can be clicked on as usual.
  • Media queries - Details of CSS media queries (such as min/max-width values) and how often they occur in stylesheets. You can click on these to jump straight to the Sources Panel. If you have source maps enabled, you'll be able to see the original styles, such as Sass.


When to use this feature

Use this when refactoring your code, or normalising brand styles across pages. For example, if you notice slight variations of a "primary" color scattered around your CSS, this Colors pane in the Overview panel is a great place to identify such a thing.

You can also use the Media queries pane within the CSS Overview Panel to check you are targeting the expected set of media query breakpoints and ensuring your pages look good on a variety of screen dimensions.

The Unused declarations pane may help improve the network and render performance by informing you which CSS can be removed.

Finally, you can use the CSS Overview panel to communicate information to the rest of your front-end team, especially new starters, on the state of the CSS code, including areas which may need focussing upon.


Extra

  • While the CSS Overview Panel can provide valuable metrics on CSS, the Lighthouse Panel provides metrics on your whole site, including JavaScript. I wrote about it in this article What’s New in DevTools 2020.
  • In addition to the article above, I've also written a guide to using Lighthouse to debug accessibility. Check it out: Accessibility In DevTools.

View the web version of this post: umaar.com/dev-tips/240-css-overview-improved
Email Marketing Powered by Mailchimp

Copyright © 2020 Umar, All rights reserved.
You are receiving this email because you signed up for Dev Tips.

unsubscribe from this list    update subscription preferences 

Older messages

Dev Tips: DevTools: Create your own keyboard shortcuts  ⌨️

Friday, November 13, 2020

The Shortcut Editor lets you assign your own preferred keyboard shortcuts to common workflows. Dev Tips DevTools: Create your own keyboard shortcuts ⌨️ Introduction The DevTools Shortcut Editor lets

Dev Tips: DevTools: The New Media Panel  🎬

Wednesday, November 4, 2020

The Media Panel in DevTools provides useful video inspection tools, useful for debugging, understanding, and learning about video. Dev Tips DevTools: The New Media Panel 🎬 I've written an article

Dev Tips: DevTools: CSS Grid Inspection ✨

Wednesday, October 28, 2020

Dev Tips DevTools: CSS Grid Inspection ✨ Hey everyone! I took a little break, but I'm back and I've got some great tips to share with you over the next few weeks! Introduction CSS Grid

Dev Tips: DevTools: Accessible colour suggestions  🎨

Friday, September 4, 2020

Get accessible colour suggestions for low contrast text Dev Tips DevTools: Accessible colour suggestions I'll be doing an AMA in a few hours! Feel free to ask anything you're curious about!

A few updates from me ⭐️

Friday, August 28, 2020

Updates from me, including new blog posts, and information on my courses A few updates from me ⭐️ Hi there! I send ~5 personal emails a year. In this one, I have useful content to share with you! But

You Might Also Like

⚙️ Limitless

Tuesday, April 16, 2024

Plus: OpenAI Japan takeover ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

The latest Go developer survey results are in

Tuesday, April 16, 2024

Plus lots of database stuff, a new Go book is in print, and a Minesweeper implementation. | #​503 — April 16, 2024 Unsub | Web Version If you wondered why you didn't get an issue last week, we took

Noonification: HackerNoons Emoji Credibility Indicators are Live on GitHub and Figma!

Tuesday, April 16, 2024

Top Tech Content sent at Noon! How are you, @newsletterest1? 🪐 What's happening in tech this week: The Noonification by HackerNoon has got you covered with fresh content from our top 5 stories of

We’re LIVE! 🤖

Tuesday, April 16, 2024

We're up to this slide [IMAGE] ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Issue #49: Juno by Alex Staravoitau

Tuesday, April 16, 2024

Today, we're looking at Juno by Alex Staravoitau. Juno offers a comprehensive Python development environment for both iPad and iPhone, designed to meet all your coding needs. It features

Microsoft’s new $1.5B AI deal is more political than you think

Tuesday, April 16, 2024

Microsoft's investment in the UAE's G42 has broad geopolitical implications... View this email online in your browser By Alex Wilhelm Tuesday, April 16, 2024 Welcome to TechCrunch AM! This

GPT-4 tops chatbot leaderboard again

Tuesday, April 16, 2024

Slack alternatives; Best Samsung phone; Insta360's new camera ZDNET ZDNET Tech Today - US April 16, 2024 placeholder GPT-4 Turbo reclaims 'best AI model' crown from Anthropic's Claude 3

LW 129 - Checkout Branding and Extensions

Tuesday, April 16, 2024

Checkout Branding and Extensions Shopify Development news and articles I've been doing a deep dive on checkout extensions and branding recently and I've decided to include links to some keys

Invitation: AI Demo Day (3rd and final)

Tuesday, April 16, 2024

3 hours til last call ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

📢 .NET 8 Series Soon!

Tuesday, April 16, 2024

Starting from Next Week! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏