-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order is destroyed when merging across multiple pages #16
Comments
Added a blurb about it in the README. I'm still wondering if it'd be possible to technically solve this. Probably not. But perhaps there's an opportunity to see what values of selectors change when the second URL comes in. Hard. |
If it is possible to log each css rule line number and filename, than you can merge them according to line number in css file page 2 Result after merge: Line number 100 .btn { font-size: 10px } |
you may find this useful: leeoniya/dropcss#22 |
thinking about it a bit more, i think a partial solution might be to get the minimal css per file, then merge all same files before merging others. EDIT: nope, this prolly won't work either :( |
@ihorsl I think it goes deeper than that. It might work'ish. Suppose it's possible to write something like that it might get it right 90% of the time, but those 10% would be a disaster. I say disaster because the work to untangle it would be really hard. You'd almost have to start over from scratch. Remember, something like this My point is, we got to be careful so we don't really need to understand what we're optimizing. Otherwise the abstraction will leak. |
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: 10px
which is not what you wanted.The text was updated successfully, but these errors were encountered: