https://github.com/aeo/style-guide
Scott Kehr
body .myClass div { ... }
body div .myClass { ... }
Make sure far right element is specific.
.arial { font: normal 11px/1.2 Arial, Helvetica, sans-serif; } .big { font-size: 15px; }
<h1 class="arial big">Big Font</h1> <h2 class="arial">Normal Font</h2>
.header, .title { font: normal 11px/1.2 Arial, Helvetica, sans-serif; } .title { font-size: 15px }
<h1 class="title">Big Font</h1> <h2 class="header">Normal Font</h2>
<html class="factoryBranding"> <link href="/factory/stylesheets/brandstyles.css"/> <a class="button">My Button</a> </html>
No need to scope if CSS is only used within scoped element
.factoryBranding .button { ... }
.button { ... }
.main-nav ul li ul li div { ... }
Stay away from complex selectors
.main-nav ul li ul li div
Don't do it. If this is necessary, then there is probably something wrong with your original style.
Try basing media queries off of content instead of device display size
Try using flexbox for grid layouts
/manifest/webcommon/category.json
{ "src": [ "<%= common_css %>category/category.css", "<%= common_css %>category/brandstyles.css", "<%= common_css %>category/widget.css" ], "dest": "<%= common_css %>category/min/category.css" }
/webcommon.war/stylesheets/category/category.css
@import category @import brandstyles @import widget