minimalcss will generate minimal CSS payloads for multiple URLs. It then combines them into one final merged version. Suppose you have two URLs with different DOM nodes present.
// pageX.html's minimal CSS
.btn { font-size: 10px }
.btn-default { font-size: 12px }
...and...
// pageY.html's minimal CSS
.btn { font-size: 10px }
First you combine this into one blob of CSS so it becomes:
.btn { font-size: 10px }
.btn-default { font-size: 12px }
.btn { font-size: 10px }
...and run it through csso.minify()
you end up with this:
.btn-default{font-size:12px}.btn{font-size:10px}
Now, in the case of this <button class="btn btn-default"> you end up with a button that is font-size: 10px which is not what you wanted.
minimalcss will generate minimal CSS payloads for multiple URLs. It then combines them into one final merged version. Suppose you have two URLs with different DOM nodes present.
...and...
First you combine this into one blob of CSS so it becomes:
...and run it through
csso.minify()you end up with this:
Now, in the case of this
<button class="btn btn-default">you end up with a button that isfont-size: 10pxwhich is not what you wanted.