Overview
Refactoring is a practice that is often overlooked when it comes to CSS. As a result, styles seem to just grow and grow, until no one knows for sure which styles apply where, or whether many rules are still used at all. In this talk, we’ll cover strategies for refactoring CSS using Sass, with a focus on maintainability of code. Topics include code organization, naming, incremental change, and handling special cases such as responsive styles.
This talk is based on Alicia’s experience refactoring thousands of lines of CSS into Sass, in a way that allowed for continuous feature development, as well as supporting multiple layers of responsive styles and device-specific styles.
Objective
Learn strategies for refactoring CSS using Sass, focusing on maintainability.
Target Audience
Developers who are responsible for writing and maintaining CSS/Sass, especially in codebases that have been around for a while.
Assumed Audience Knowledge
CSS and Sass
Five Things Audience Members Will Learn
- Reasons to refactor CSS
- Code naming and organization conventions
- Different ways to DRY up code with Sass
- Identify problem areas that need refactoring
- How to refactor incrementally