π¨ Sass Warning in Angular 19 Build β font-size: clamp(...) Triggers Deprecation Warning
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
When compiling SCSS in an Angular 19 project using the default builder (@angular-devkit/build-angular:application), any font-size: clamp(...) inside a mixin triggers a deprecation warning.
However, running Dart Sass directly (dart-sass _typography.scss output.css) compiles without warnings.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Minimal Reproduction
1. Create a mixin in _typography.scss:
@mixin font-size($min: 0.8rem, $preferred: 1rem, $max: 1.5rem) {
font-size: clamp($min, $preferred, $max);
}
2. Use it inside a selector:
section {
@include font-size();
}
3. Run Angular Build:
ng build --configuration=development
π¨ Warning Appears:
β² [WARNING] Deprecation [plugin angular-sass]
projects/shared/assets/styles/_typography.scss:118:2:
118 β font-size: clamp(0.8rem, 1rem, 1.5rem);
4. Workaround: Moving Inside @media
Changing usage to:
@media (min-width: 0) {
@include font-size();
}
β
Suppresses the warning.
Please provide the environment you discovered this bug in (run ng version)
Angular Version: 19.1.7
Sass Version: 1.83.1
Builder: @angular-devkit/build-angular:application
OS: Ubuntu 22.04
Node: 20.x
"devDependencies": {
"@angular-devkit/build-angular": "^19.1.7",
"@angular/cli": "^19.1.7",
"@angular/compiler-cli": "^19.1.6",
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
"typescript": "~5.7.2"
},
Anything else?
Expected Behavior
Angularβs Sass compilation should match the behavior of Dart Sass, without warnings for valid clamp() usage.
Actual Behavior
A deprecation warning appears, but moving the mixin inside @media (min-width: 0) prevents it.
Questions
- Is Angular applying additional transformations to clamp()?
- Why does the warning disappear inside @media?
- Could this be related to how Angular processes SCSS files internally?
Unfortunately, we are unable to reproduce the problem as described with the latest version of Angular. Can you provide further details or a minimal reproduction?
Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.
If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.