Live data from Hacker News

Csscss: a CSS redundancy analyzer that analyzes redundancy

zmoazeni.github.io

41–46 of 46 posts

Re: Csscss: a CSS redundancy analyzer that analyzes redundancy

#42
Personally I used Chrome dev tools - and it has a feature called 'CSS Selector Profiles' under the 'profile' tab.

You can 'record' yourself using a website - and Chrome records how many 'hits' each css rule gets.

This is better than Dust-me, and all the other CSS rule detectors - because it allows you to use your site in a 'dynamic' way - and test for all the edge CSS cases (like resizing your browser to small, or enabling an error message etc).

After using my SaaS for an hour - I found hundreds of rules that just never got used.

Also - it tells you how many times a rule got used. So I found a few number of rules that literally only got used once, and I could often re-write them into 1-2 bigger rules - further reducing my CSS overhead.

Re: Csscss: a CSS redundancy analyzer that analyzes redundancy

#43

Earlier quoted context omitted.

I prefer Select2 over Chosen http://ivaynberg.github.io/select2/

The problem with Select2 is that users are now _required_ to have js on to just use a silly dropdown. Chosen actually degrades gracefully.

which you need in a lot of cases for search engine crawlability.

Re: Csscss: a CSS redundancy analyzer that analyzes redundancy

#44
post #17

Earlier quoted context omitted.

I prefer Select2 over Chosen http://ivaynberg.github.io/select2/

I'm using Select2 on my site http://gitignore.io/ and it's been awesome so far.

That's neat, but howcome something like Django doesn't "inherit" from the Python preset?

Re: Csscss: a CSS redundancy analyzer that analyzes redundancy

#45

Personally I used Chrome dev tools - and it has a feature called 'CSS Selector Profiles' under the 'profile' tab. You can 'record' yourself using a website - and Chrome records how many 'hits' each css rule gets. This is better than Dust-me, and all the other CSS rule detectors - because it allows you to use your site in a 'dynamic' way - and test for all the edge CSS cases (like resizing your browser to small, or en…

That sounded really cool. So I opened up chrome, navigated to YouTube, opened the dev-tools, turned on CSS Selector Profiles, and chrome immediately crashed.

:( awwwww.

Re: Csscss: a CSS redundancy analyzer that analyzes redundancy

#46
post #18

CSSO [1] is a tool that removes duplicate declarations during minification instead of just warning about them. It also performs more advanced structural optimizations. [1] http://bem.info/tools/csso/

I think the purpose of this package is more about making existing source code easier to maintain (applying DRY principals to CSS) than about browser-oriented optimization (thus purpose of CSSO.)

You could keep the csscss'ed source in version control (easy to maintain), and use csso as an automated step before deploying.
Post reply on HN