From the course: CSS: Refactoring Style Sheets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modularize CSS

Modularize CSS - CSS Tutorial

From the course: CSS: Refactoring Style Sheets

Start my 1-month free trial

Modularize CSS

- [Instructor] I've mentioned modularization of CSS several times because it's a key part of refactoring. Now it's time to take a closer look at that. Ray did a great job modularizing the rules in the original style sheet for this project. You can see that each section is clearly marked up with comments and the structure of the style sheet follows the structure of HTML. In other words, I don't have to do anything here to improve the code where modularization is concerned. But modularization is not just for literal modules. It also be used for refactoring, especially when you're working with large code files. Case in point, this bootstrap.css file that in between the movies I've tried to clean up to get rid of most of the errors and also format the content properly. Scrolling down a bit in this style sheet, you'll find this huge section of rules related to glyphs or icons. These rules make it possible to use the prepackaged font icons from Bootstrap in different places, and I think a…

Contents