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.

Automatic rational property order

Automatic rational property order - CSS Tutorial

From the course: CSS: Refactoring Style Sheets

Start my 1-month free trial

Automatic rational property order

- [Narrator] There's one more feature I want to add to the automated linting and formatting process. You remember from earlier in the course I talked about rational property order. While we can get stylelint and prettier to literally sort that out for us too. The key is a stylient configuration called stylient config rational order. It's installed the same way as before. We go to the terminal, type in npm install and then stylelint config rational order save dev. The new configuration is brought in and we can add it directly to our list of extended stylelint rules. So here we already have stylelint config standard and the prettier stylelint config so I'll just go to the end here and say stylelint config rational order. Save that and now I can go into style.css and find a rule that has an order that's a little bit out of whack. You can see here that the order has color first and then margin, then fonts size and then padding. So if I save this file now, prettier and stylelint and…

Contents