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 - CSS Tutorial
From the course: CSS: Refactoring Style Sheets
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Set up an npm project4m 39s
-
(Locked)
Install and configure stylelint5m 20s
-
(Locked)
Make stylelint work in Visual Studio Code3m 56s
-
(Locked)
Demo: How stylelint works5m 30s
-
(Locked)
Install and configure Prettier3m 24s
-
(Locked)
Make Prettier work in Visual Studio Code4m 11s
-
(Locked)
Automatic rational property order2m 18s
-
-
-
-