H
H
helvar2012-10-26 12:27:35
css
helvar, 2012-10-26 12:27:35

Compress and merge CSS without duplicate selectors

Good day.
There is a task to reduce the volume of CSS files. MVC4 project.
For work, standard tools from System.Web.Optimization were used. There are conditionally 2 files: one normalize.css, the other with their own styles. The System.Web.Optimization.Styles.Render method concatenates files, compresses, but keeps duplicate selectors if they are repeated. For example, both have body, html, etc. I don’t feel like editing normalize.css by hand.
Question:
1. Is it possible to force System.Web.Optimization to combine duplicate selectors?
2. Perhaps there is a better library that solves this problem

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fddima, 2012-11-08
@fddima

In cases slightly more complex than elementary, it is impossible to combine CSS rules, because they are applied in the order in which they are defined.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question