".&" in compiled CSS
Hi all, I purchased the Metronic template and used the HTML version, I'm getting CSS syntax errors, every time I build, in /dist/assets/css/styles.css:
.kt-menu-item.active > .kt-menu-link.& {
border-radius: var(--radius);
} I'm getting this error in both my VS Code and whenever I run
npm run build (I used it with Anguar following this guide: https://keenthemes.com/metronic/tailwind/docs/getting-started/integration/angular):
â² [WARNING] Expected identifier but found "&" [css-syntax-error]
I'm not a CSS expert, but can anyone tell me if there is a special purpose for that syntax and if I can remove those tags with the error? Claude seemed to suggest that they can be removed. Thanks!
Replies (2)
A possible comment:
The
&is normally the Sass parent selector, so it can be used to reference the outer selector in nested SCSS. However,.kt-menu-link.&looks unusual because the&appears after the class selector, and that may be why the compiler reports a syntax error. I’d check the original SCSS source and Metronic’s build configuration before removing it, rather than editing the generateddistCSS directly. ([sass-lang.com][1])For anyone also working on budgeting or financial planning, a Tax estimate can be useful for understanding expected tax obligations.
Hi Vincent Lee
Thank you for your feedback. The .& syntax is valid Tailwind CSS v4 syntax for @custom-variant blocks. We will fix it for Angular.
Thanks