Error in Css when using clamp
Installed product versions
- Visual Studio: 2022 Community
- This extension: 2.9.9
Description
Bundling fails if clamp CSS function is used anywhere in css code.
Steps to recreate
- Insert (for example) this line in your css:
font-size: clamp(1.625rem, 1.3036rem + 1.4286vw, 3rem); - Try to bundle it using this extension
Current behavior
Bundling fails with error: Error (Bundler & Minifier) Unexpected token, found ' '
Can you check if this is supported by NUglify?
The css you provided compiles fine for me, can you provide the entire file that is causing the error?
Sure thing.
Just did experiment with only this line in css file:
color.css
body { font-size: clamp(1.625rem, 1.3036rem + 1.4286vw, 3rem); }
bundleconfig.json
{ "outputFileName": "wwwroot/css/color.min.css", "inputFiles": [ "wwwroot/css/color.css" ], "minify": { "enabled": true, "commentMode": "none" } }
Result in Visual studio 2022 (Version 17.9.0) task runner:
wwwroot/css/color.min.css Unexpected token, found ' ' Unexpected token, found ' ' Expected function, found ' ' Expected semicolon or closing curly-brace, found ' '
This error is caused by using math inside the clamp function; Can you add a bug to the NUglify repository and link it here?
Sorry, I'm no longer using BundlerMinifier.