less.ruby icon indicating copy to clipboard operation
less.ruby copied to clipboard

CSS optmizer

Open hallodom opened this issue 12 years ago • 2 comments

Hi, are there any plans to incorporate a css optimiser option? I find myself avoiding features in Less such as inheritance because I'm aware that they aren't optimised and repeats redundant declarations.

Less example:

 .strong { background:#31343b; color:white; font-weight:normal; padding:2px 10px; margin-right:10px; }
 .small { .strong; background:#ff0000; }

Compliles to:

.strong {
  background: #31343b;
  color: white;
  font-weight: normal;
  padding: 2px 10px;
  margin-right: 10px;
}
.small {
  background: #31343b;
  color: white;
  font-weight: normal;
  padding: 2px 10px;
  margin-right: 10px;
  background: #ff0000;
}

When optimised it should be:

.strong,.small{background:#31343b;color:white;font-weight:normal;padding:2px 10px;margin-right:10px}
.small{background:#ff0000}

hallodom avatar Mar 21 '12 11:03 hallodom

At least optimise when you're using inheritance so you can control the ordering of you're classes?

hallodom avatar Mar 21 '12 11:03 hallodom

Agreed. Would be great if whenever using a mixin, it output as shown above.

mindfullsilence avatar May 30 '13 03:05 mindfullsilence