BundlerMinifier
BundlerMinifier copied to clipboard
error on css if using ":has"
Installed product versions
- Visual Studio: 2022 Professional
- This extension: 2.9.3
Description
Severity Code Description Project File Line Suppression State Error 0 Expected identifier, found ':' ...\wwwroot\Themes\Main.css
Steps to recreate
.form-property-check-item .drop-value:not(:has(input:checked)) + .property .property-list-title,
Current behavior
if i have :has(xxxxx) gives the error
Expected behavior
if i remove :has(xxxxx) its ok
Can you provide a small sample application that I can use to debug your issue? I've tried multiple combinations of :has and they all compile as expected.
.l-test:has(.l-te) { cursor: pointer; }
.l-test:not(:has(.l-te)) { cursor: pointer; }
.form-property-check-item .drop-value:not(:has(input:checked)) + .property .property-list-title { cursor: pointer; }
@failwyn I believe the issue is in the BuildBundlerMinifier nuget package. If I uninstall, the extension compiles the :has pseudo-class without error.
Thanks, I’ll test using the nuget package when I get back to work next week.
For me it fails if the has selector includes an id fragment, but not with a class. This fails
.MaquetacionColumnas:has(#VentaRapida) {
position: relative;
}
This works OK
.MaquetacionColumnas:has(.VentaRapida) {
position: relative;
}
Visual Studio 17.8.0 Bundler & Minifier 2.9.9
I think that it should also be noted here that support for the :has selector fails:
@supports selector(:has(*)) {
.VentaRapida {
position: absolute;
}
}
Gives an error due to the @supports
block
@AlfonsoML would you mind adding an issue to the NUglify Repo about the :has selector with the Id and create a new issue for @support?
The :has() with an id it's working properly for me in current master of NUglify:
var result = Uglify.Css(@".MaquetacionColumnas:has(#VentaRapida) {
position: relative;
}");
.MaquetacionColumnas:has(#VentaRapida){position:relative;}
but it's still generating the same error in Bundler&Minifier:
(Bundler & Minifier) Expected identifier, found '#VentaRapida'
I've created https://github.com/trullock/NUglify/issues/401 for the "@supports selector"