Friday, July 1, 2022
  • Home
  • Event
  • Technology
  • Program
  • Education
No Result
View All Result
I-Capitals
No Result
View All Result
Home Program

Using the CSS Me Not Bookmarklet | CSS-Tricks

admin by admin
January 15, 2022
in Program
0
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

Stoyan is absolutely correct. As much as we all love CSS, it’s still an important player in how websites load and using less of it is a good thing. He has a neat new bookmarklet called CSS Me Not to help diagnose unnecessary CSS files, but we’ll get to that in a moment.

Related Posts

Bunny Fonts | CSS-Tricks – CSS-Tricks

Text-overflow: ellipsis considered harmful | CSS-Tricks

How I Chose an Animation Library for My Project | CSS-Tricks

Help Shape the Future of CSS-Tricks! | CSS-Tricks

The [problem] is that CSS is in the critical path, it blocks rendering and often even JavaScript execution. We love CSS, it’s magic, it can do unbelievable feats and fix broken UIs and manipulate images and draw amazing pictures. We love CSS. We just want… less of it, because of its inherently blocking nature.

Sometimes our sites use entire stylesheets that are simply unnecessary. I hate to admit it, but WordPress is a notorious offender here, loading stylesheets for plugins and blocks that you might not even really be using. I’m in that position on this site as I write. I just haven’t found the time to root out a couple of little stylesheets I don’t need from loading.

Stoyan created a quick bookmarklet called CSS Me Not to see all those CSS files. The big benefit, of course, is that it lets you know what you’re up against.

You could find these stylesheets in DevTools as well, but the CSS Me Not bookmarklet makes it extra easy and has a killer bonus feature: turning off those stylesheets. Testing the bookmarklet here on CSS-Tricks, I can see four stylesheets that WordPress loads (because of settings and plugins) that I know I don’t need.

If you wanted to do this in DevTools instead, you could filter your Network requests by CSS, find the stylesheet that you want to turn off, right-click and block it, and re-load.

DevTools window screenshot with the Network panel open and the select menu open on a listed stylsheet with the option to block the request URL highlighted in bright blue.

I’ve been fighting this fight for ages, dequeuing scripts and styles in WordPress that I don’t want.

Removing totally unused stylesheets is an obvious win, but there is the more squirrely issue of removing unused CSS. I mention in that post the one-true-way of really knowing if any particular CSS is unused, which is attaching a background-image to every selector and then checking the server logs after a decent amount of production time to see which of those images were never requested. Stoyan corroborates my story here:

UnCSS is sort of a “lab”. The “real world” may surprise you. So a trick we did at SomeCompany Inc. was to instrument all the CSS declarations at build time, where each selector gets a 1×1 transparent background image. Then rummage through the server logs after a week or so to see what is actually used.

Next Post

Help! Half My Class is Out with COVID

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts

Technology

Emerald City Comic Con takes heat for not requiring masks or vaccination at upcoming event in Seattle – GeekWire

by admin
July 1, 2022
0

ReedPop, the company behind the Emerald City Comic Con in Seattle, announced Wednesday that it plans to substantially relax its...

Read more

Emerald City Comic Con takes heat for not requiring masks or vaccination at upcoming event in Seattle – GeekWire

First Mode agrees to combine with Anglo American’s zero-emission truck business

Developer bootcamp Coding Dojo lands $10M to train more software engineers – GeekWire

Microsoft’s president on turbulent times for the company, country, and world – GeekWire

Bunny Fonts | CSS-Tricks – CSS-Tricks

High-tech screen uses facial recognition to personalize flight info – GeekWire

Load More

Popular Posts

2021 Event Tech Investments and Acquisitions Review

by admin
January 10, 2022
0

Microsoft detected ‘destructive cyberattacks’ against Ukraine hours before Russian invasion

by admin
February 28, 2022
0

2022 Award-Winning Kids Books–Perfect for the Classroom Library

by admin
February 2, 2022
0

Copyright © 2021 - i-Capitals.com DESIGNED AND DEVELOPED BY TEAM WORDPRESS BLOGX

No Result
View All Result
  • Home
    • Home 1
    • Home 2
    • Home 3
  • Event
  • Technology
  • Program
  • Education

Copyright © 2021 - I-capitals.com - DESIGNED AND DEVELOPED BY TEAM WORDPRESS BLOGX