Answer the question
In order to leave comments, you need to log in
How to optimize css code?
Hello! Wrote a very large file with styles for the site. Wrote if only as that is, in a quick hand. Now I want to optimize it.
Is this considered an optimization if it was margin-top: 10px; margin-bottom:5px; and it became margin: 10px 0px 5px;
Answer the question
In order to leave comments, you need to log in
An optimization can be seen as removing duplicate styles/selectors and sequencing the selectors correctly. Then take css lint or scss lint, find the config that suits you and clean everything.
And these incomprehensible zeros from combining padding margins can play a cruel joke on you.
run your css through gulp shorthand https://github.com/vol7/shorthand
and also through gulp-csso https://github.com/ben-eb/gulp-csso
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question