Solid, scalable, maintainable CSS architecture.
@import "vendor/normalize.css" @import "base" @import "components/*"
Starts us on a level playing field.
*, *:before, *:after { box-sizing: border-box; } a { color: green; }
.page {} .header {} .comment-box {} .avatar {}
components/ _avatar.scss _comment_box.scss _header.scss _page.scss
.avatar { display: block; > img { display: block; max-width: 100%; } }
// components/_comment_box.scss .comment-box__avatar { ... }
// components/_profile_box.scss .profile-box__avatar { ... }
.comment-box__avatar { position: absolute; top: 10px; left: 10px; height: 50px; width: 50px; }
<div class="comment-box"> <div class="comment-box__avatar"> <a class="avatar" href="#"> <img src="..."> </a> </div> </div>
<div class="comment-box"> <div class="comment-box__avatar"> <Avatar src="foo.jpg" /> </div> </div>
.comment-box { a { color: blue; } }
.comment-box { > a { color: blue; } }
.comment-box__link { color: blue; }
If a class doesn't fit on a 27" monitor without scrolling, it's too big!
.comment-box { ... } .comment-box__avatar { ... a { ... } img { ... } }
stylesheets/ app.scss _base.scss vendor/ normalize.css components/ _comment_box.scss _header.scss _page.scss ...
components/ comment_box/ _comment_box.scss _comment_box.html _comment_box.js page/ _page.scss _page.html _page.js ...
stylesheets/ _utilities.scss _forms.scss _typography.scss _some_page_specific_junk.scss
stylesheets/ base/ _utilities.scss _forms.scss _typography.scss _some_page_specific_junk.scss components/ _new_thing.scss