Clean Up Your Code With Modular CSS

Hope Armstrong
Mar 8, 2018 · 7 min read
Image for post
Image for post
Let’s get MODular!

CSS. It’s a web designer’s playpen. With so many colors, type settings, layout options, and responsive possibilities, it’s easy to turn a stylesheet into a million line nightmare. However, with a few simple actions you can clean up the mess so the CSS works with you, not against you. A few weeks ago, frontend developer Julie Cameron came through our virtual Treehouse office and bestowed some wisdom we still can’t shake. So now I’m sharing it with you all!


Your CSS may be a mess because…

Image for post
Image for post

Image for post
Image for post

What is Modular CSS?

OOCSS — Principles

.categoryList h2 { styles }

.footer h2 { copied styles }

.sectionHeader { reusable styles }

OOCSS — Objects

OOCSS — Best Practices


Image for post
Image for post

How can I get started using Modular CSS?


Recommended Courses


Treehouse

We believe anyone can be a developer.

Hope Armstrong

Written by

Product Designer, Illustrator, Former Troll Collector

Treehouse

Treehouse

We believe anyone can be a developer. We’ve also seen that with the right portfolio of skills and experience, you don’t need a Computer Science degree to launch a career. That’s why we teach skills in cutting edge technology to prepare our students to take charge of their future.

Hope Armstrong

Written by

Product Designer, Illustrator, Former Troll Collector

Treehouse

Treehouse

We believe anyone can be a developer. We’ve also seen that with the right portfolio of skills and experience, you don’t need a Computer Science degree to launch a career. That’s why we teach skills in cutting edge technology to prepare our students to take charge of their future.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store