Active
Project:
Drupal core
Version:
main
Component:
asset library system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Nov 2009 at 23:20 UTC
Updated:
25 Nov 2021 at 18:26 UTC
Jump to comment: Most recent
Comments
Comment #1
casey commentedtagging
Comment #2
casey commentedFor more info see: http://www.w3.org/TR/REC-CSS2/cascade.html#at-import
When a stylesheet is aggregated, non-resolved @import rules (like external stylesheets) should be moved to the top, else browsers won't process them.
@import rules that weren't at the top of their actual stylesheet, should not be moved to the top of the aggregate stylesheet either. This is what is currently going wrong.
Not very urgent as long as modules have valid stylesheets without @import rules that aren't at the top.
Comment #3
casey commentedNote that currently also @import rules are moved that occur in comments. e.g.
Result of CSS aggregation:
Comment #4
casey commentedComment #5
wim leersNow that #352951: Make JS & CSS Preprocessing Pluggable has landed, along with better tests for CSS aggregation/minification, it should be a whole lot easier to do this. See #2014851: Drupal CSS preprocessing breaks protocol-relative paths for an example.
Comment #6
dawehnerComment #15
larowlanTriaged as part of Bug Smash Initiative
The code in question is in
\Drupal\Core\Asset\CssCollectionOptimizer::optimizeComment #16
darvanenClosed #646244: Only @import rules at top of aggregated stylesheets should be resolved. as a duplicate of this issue because it's the two combined that create the undesirable effect of bringing otherwise defunct rules into play.
Comment #17
gabrieldaHello, I will work on this issue.
Comment #18
gabrieldaHello, I could not progress much, hence I am unassigning myself