By efficient I mean less code (less css rules).
Because I’m converting a CSS file to less, and I’m surprised to find out that the compiled CSS file is quite small (I haven’t finished yet :P)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
LESS (when compiled) and Sass both minify your CSS. In addition to stripping out whitespace, you’ll sometimes see things like
border: 0 10px 0 10pxget turned intoborder: 0 10pxor colors like#666666turned into#666. It isn’t any more efficient, but it does make a smaller download for the user (which is valuable for mobile devices).That said, Sass has a unique directive called @extend, which allows you to group your styles logically in the pre-compiled state, but will group them together to avoid duplication in the compiled state.
Will output something that looks like this:
It doesn’t seem like that big of a deal with 2 classes only having one thing in common, but its a bigger deal the more elements you are using and the more things they have in common.
Otherwise no. The efficiency is entirely based on the author.