Problem/Motivation
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;
}
}Steps to reproduce
- install ui_suite_bootstrap
- install ui_styles
- Add this div anywhere
<div class="d-block d-md-none">TEST</div> - The div should hide in desktop but does not
Proposed resolution
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.
Issue fork ui_styles-3547507
Show commands
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