Ask HN: CSS architecture techniques?
After writing lots of CSS in lots of client sites, I'm definitely missing a Grand Unified Theory of CSS. I understand that the GUT may not be available to me when operating in other people's sandboxes, but still... So I'm looking for best practices on high level CSS architecture/organization. Should I:
* Minimize the length of a selector to make it general? Maximize it to make it specific? (I tend to be hyper-specific)
* Use a standard hierarchy of selector (#page-name .content-block .sub-element .element).
* Use CSS modules (/css/widgets/user_list.css, /css/widgets/merchant.css).
* Use SASS or SCSS?
* Divide CSS by function (e.g. .left, .right) and module (e.g. .widget, .widget-calendar).
* Pick jQuery-UI/ExtJS/etc, study their CSS and follow their lead?
Can you recommend great articles, advice or guides? As with programming, I know that there are a number of styles of coding for CSS; I just haven't seen them discussed as much as OO vs FP on HN and CSS seems pervasive, critical and, basically, randomly used.
2 comments
[ 2.6 ms ] story [ 17.3 ms ] threadhttp://news.ycombinator.com/item?id=2376782