Closed (fixed)
Project:
UI Styles
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2025 at 18:31 UTC
Updated:
12 Oct 2025 at 17:09 UTC
Jump to comment: Most recent
At Rules are stripped from output stylesheet.
StylesheetGenerator::generateCss strips all surrounding rules by calling CSSBlockList::getAllDeclarationBlocks() (including "AtRuleBlockList").
So this rule will work :
.d-md-none {
@media (min-width: 768px) {
display: none !important;
}
}But not this one :
@media (min-width: 768px) {
.d-md-none {
display: none !important;
}
}<div class="d-block d-md-none">TEST</div>
Do not get blocks with getAllDeclarationBlocks() method. Process level 1 content of parsed css separately depending on their type. For AtRuleBlockList items, process included blocks and generate css by calling render on the AtRule not on each child.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mattlc commentedComment #4
mattlc commentedTests added.
Comment #5
grimreaperComment #7
grimreaper