Nested CSS @apply mixins are breaking when minified.
See original GitHub issueI’ve run into a problem after CSS has been minified (through kangax/html-minifier which uses clean-css) where the last property being applied to a CSS mixin variable loses its semi-colon. If this property is another mixin, it breaks, particularly for IE11 and Edge. Could this please be fixed so that the semi-colons are preserved?
As a side note, I’ve found a way around this by adding another property, but it gets messy, so if this could be fixed, it would be greatly appreciated.
Input CSS
--my-mixin: {
@apply --another-mixin;
};
Actual output CSS
--my-mixin:{@apply --another-mixin};
Expected output CSS
--my-mixin:{@apply --another-mixin;};
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Nested mixins in LESS behaviour - Stack Overflow
When you call the mixin it overwrites the @parent variable for the current scope, which gets then inherited to nested rules, where you...
Read more >{...} nested class as a mixin – unspecified behaviour #2453
But re-use of CSS rulesets as mixins, especially when it comes to nesting and complex selector hierarchies, is relatively indirect/supplementary ...
Read more >Sass Techniques from the Trenches | CSS-Tricks
There are a couple of new ideas here. The mixin has a nested function called @content . So, in the .MyComponent class, we're...
Read more >CSS with nested calc broken - WordPress.org
To do that, you have to go to “Settings” -> “Optimize CSS” -> “CSS Files Minification” and then below “Do not minify the...
Read more >Sass Mixins vs Extends: The Data - Belly Card Engineering
For me, the choice between mixins and extends breaks down into three ... File size for both raw and minified CSS was smaller...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix is out in 3.4.26 and 4.1.2.
I’m using it in Polymer web components. I believe Polymer provides a shim for browsers when it isn’t supported natively.