CssLanguagePlugin does not mangle classes in attribute selectors
Closed this issue · 0 comments
ericcornelissen commented
Bug Report
- Package(s): language-css
- Version(s):
0.1.27
Description
The CssLanguagePlugin
won't mangle CSS classes in attribute selectors (e.g. [class="cls-foo cls-bar"]
). This is because it's missing support for the multi-value-attributes
expression type. As such, this bug applies more generally to any plugin that relies on the multi-value-attributes
expression type.
Actual Behaviour
-
Have a CSS with a attribute selector for the
class
attribute. For example:.cls-foo { color: red; } [class="cls-foo"] { color: purple; }
-
Run WebMangler CLI (version
0.1.6
) with WebMangler Core (version0.1.24
) and at least WebMangler CSS Language Plugin version0.1.27
and WebMangler CSS Class Mangler version0.1.23
. -
Observe that the CSS file isn't mangled completely. For the example above:
.a { color: red; } [class="cls-foo"] { color: purple; }
Expected Behaviour
The mangled CSS looks something like:
.a {
color: red;
}
[class="a"] {
color: purple;
}