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.

Practical approach to CSS refactoring

Practical approach to CSS refactoring - CSS Tutorial

From the course: CSS: Refactoring Style Sheets

Start my 1-month free trial

Practical approach to CSS refactoring

- [Instructor] Let's say you open an old project you haven't worked on in a long time or you inherit a project from another developer. How do you go about the actual refactoring? Well, here's a very general guideline to step you through the process. And again, this is just an opinion. Try this approach and if it doesn't work, just change it. Here's my practical approach to CSS refactoring. First, debug. Use tools and your own skills to find and fix any errors that may lurk within your code. Trust me when I say this, there will be bugs. Second, remove bad practices and update to new best practices. No matter when the code was written and who wrote it, there will be bad practices or old practices built in. Update, upgrade, and move the code up to the current standards. This could mean something as basic as removing browser prefixes for border radius, or something as involved as changing global layouts from float and clear to grid and flex. Third, audit. Use tools to find unused code…

Contents