You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens because deleting an empty layer might change the layer priority (see closed issue #1544). To prevent keeping useless empty layers, cssnano should remember all the layer names it has seen before, but currently it does not do it.
When why do you merge the styled into a single layer declaration? If you have to keep the layers, isn't better not to merge them?
As far as I remember, the code that merges is the same for all at-rules, and predates even existence of @layer declarations. When layers became more widespread, a fix was applied to preserve empty at-rules only for the @layer case.
Describe the bug
If my CSS code contains several instances of using
@layer
rule with the same layer name, after the minification CSS nano will keep each usage of it.This code
Is compiled into this (I added whitespaces)
Expected behaviour
The following
@layer components {}
blocks do not affect the styles, therefore they can be removedSteps to reproduce
The steps are described above
Version
6.1.2
Preset
default
Environment
Package details
Additional context
No response
The text was updated successfully, but these errors were encountered: