By: Louis Novick
"What" is modular CSS?
"Why" modular CSS?
"How" can we rethink our CSS?
"Thinking Modular CSS." Thinking Modular CSS. N.p., n.d. Web. 30 June 2015.
http://talks.drewb.io/tmcss-score/#319
"Thinking Modular CSS." Thinking Modular CSS. N.p., n.d. Web. 30 June 2015.
http://talks.drewb.io/tmcss-score/#319
"Smart people on great teams cede to the fact that they are afraid of their own CSS. You can't just delete things as it's so hard to know if it's absolutely safe to do that. So, they don't, they only add. I've seen a graph charting the size of production CSS over five years show that size grow steadily, despite the company's focus on performance."
Coyier, Chris. "The Debate Around "Do We Even Need CSS Anymore?" | CSS-Tricks." CSS-Tricks. N.p., 26 June 2015. Web. 28 June 2015.
There could be 3,000 or more lines of code you didn't write
CSS must be modified over and over again and will grow in a 1:1 relationship with complexity of content
10kb
18kb
50kb
"Not invented here" syndrome
Reusable pieces
"The traditional way to handle complexity in programming is to break large complex things into smaller well-formed “modules”. Focusing on creating healthy front-end modules instead of complete pages can help break complex page layouts into reusable solutions."
- Dave Rupert
This is not just a page!
It is a collection of front-end modules. Reusable objects.
Reusable style patterns that can be used on any other page.
<div class="avatar">
<div>
<a href="#" title="">
<img src="image.jpg" alt="" />
</a>
<h3><!-- ... --></h3>
<p><!-- ... ---></p>
</div>
<div>
<ul>
<li></li>
<!-- ... -->
</ul>
</div>
<div>
<!-- ... -->
</div>
<div>
<!-- ... -->
</div>
</div>
.avatar {}
.avatar div {}
.avatar img {}
.avatar ul {}
.avatar ul li {}
.avatar h3 {}
.avatar p {}
.avatar {}
.avatar-name {}
.avatar-title {}
.avatar-img {}
.avatar-list {}
.avatar-stats {}
.avatar-link {}
.avatar-thumbs {}
.card {}
.card-name {}
.card-title {}
.card-img {}
.card-list {}
.card-stats {}
.card-link {}
.card-thumbs {}
.list {}
.list {}
/* ... */
.card {}
.list {}
/* ... */
.card {}
.pbf {
padding-bottom: 0;
}
.pbxs {
padding-bottom: .5em;
}
.pbs {
padding-bottom: 1em;
}
.pbm {
padding-bottom: 1.5em;
}
.pbl {
padding-bottom: 2em;
}
.pbxl {
padding-bottom: 2.5em;
}
http://talks.drewb.io/tmcss-score/#319
http://appendto.com/2014/04/oocss/
http://drewbarontini.com/articles/single-responsibility/
http://mvcss.io/
http://www.slideshare.net/stubbornella/object-oriented-css