
CSS Stats - sethbannon
http://cssstats.com/
======
mxpxrocks10
hey CSS Stats - let me know if we can sponsor you. chris at maxcdn com - can
get you an account right now.

------
sorahn
This is awesome in a "now I want to spend ages refactoring my CSS to make my
numbers look awesome" kind of way.

------
shdon
I get only blank pages returned. Assuming it has buckled under the onslaught
of HN visitors, what does it show when it works normally?

~~~
mrmrs
Apologies for the downtime. Should be back up now.

~~~
NKCSS
Still not loading here.

------
benologist
What would this tool be useful for?

It almost seems like an on boarding tool for 3rd party CSS but you can't
construct or derive style rules from any of the presented formats, just raw
colors/sizes.

The charts and metrics all seem superfluous.

~~~
harlanlewis
The specificity graph is quite meaningful. For example, compare the
specificity graphs for Yahoo
([http://cssstats.com/stats?url=http%3A%2F%2Fyahoo.com#specifi...](http://cssstats.com/stats?url=http%3A%2F%2Fyahoo.com#specificity-
graph)) and Amazon
([http://cssstats.com/stats?url=http%3A%2F%2Famazon.com#specif...](http://cssstats.com/stats?url=http%3A%2F%2Famazon.com#specificity-
graph)) - selected for both being public-facing sites of similar size.

Because CSS rules are applied by specificity
([http://specificity.keegan.st/](http://specificity.keegan.st/)) first and
source order second, any property overwrites later in the document require
equal or greater specificity than rules in the middle. A chart with a mountain
in the middle today will probably develop more mountains on the right over
time - it's a leading indicator of poor maintainability. Pairing this tool
with one that tells you the line number of offenders would help in identifying
areas in need of refactor.

Total vs Unique declarations reveals opportunities for reusable OOCSS-type
classes (which itself can be difficult to do in a stylesheet full of
specificity mountains).

The colors aren't terribly useful without a histogram and some of the other
stats do seem a bit superfluous, but they may just need someone more
experienced than I to draw the right conclusions.

~~~
harlanlewis
Amazon might not be the best example - loading
[http://cssstats.com/stats?url=http%3A%2F%2Famazon.com#specif...](http://cssstats.com/stats?url=http%3A%2F%2Famazon.com#specificity-
graph) multiple times has generated multiple, _very_ different graphs. I
wonder if the CSSStats bot has been thrown into more than one A/B experiments.

~~~
mrmrs
It's not currently grabbing all of the stylesheets - we are working on a fix
for this at the moment.

------
peterjmag
If you'd like to collect similar stats for your own code base, check out
parker[1] and stylestats[2]. At my company, we aggregate certain numbers from
both tools and send them to Graphite to monitor over time, as inspired by this
talk from GitHub[3][4].

[1] [https://github.com/katiefenn/parker](https://github.com/katiefenn/parker)

[2] [https://github.com/t32k/stylestats](https://github.com/t32k/stylestats)

[3] [https://speakerdeck.com/bleikamp/sass-at-
github?slide=68](https://speakerdeck.com/bleikamp/sass-at-github?slide=68)

[4] [https://vimeo.com/86700007](https://vimeo.com/86700007)

------
natmaster
Doesn't support gzip compressed files? I'm getting back garbage from my
production css file.

~~~
mrmrs
Please feel free to open an issue and let us know specifically what is going
wrong

[http://github.com/mrmrs/cssstats/issues](http://github.com/mrmrs/cssstats/issues)

Thanks!

------
CoachRufus87
Is there a browser extension version of this so that it can be run on pages
that require authentication?

~~~
mrmrs
We don't have one yet - but that's a great idea. We'd like to support basic
auth somehow.

------
javajosh
I had no idea Facebook's CSS was so minimal (less than a kilobyte!). Bravo,
FB.

~~~
zhng
I'm seeing 265 KB for Facebook's CSS.

[http://cssstats.com/stats?url=http%3A%2F%2Ffacebook.com&name...](http://cssstats.com/stats?url=http%3A%2F%2Ffacebook.com&name=Facebook)

~~~
javajosh
Now I'm seeing 49kB. Strange. It's not cookies either because it's 49 in an
Incognito window as well.

~~~
MildlySerious
A/B testing I would assume.

------
_mikz
Definitely will try to improve my styles to reduce unique definitions.

------
ww520
The site loads very fast. That's impressive.

------
elwell
Why not just host on aws?

~~~
mrmrs
It is hosted on AWS! I am just a dev ops n00b. Working out the kinks at the
moment.

