Open
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When upgrading from v14 to v15, conversion of mat.define-typography-config()
to mat.define-legacy-typography-config()
is broken.
Reproduction
Steps to reproduce:
- Checkout tchandelle/angular-components@08589da
- Upgrade to v15 with
npx ng update -C @angular/material@15
- See the issue here: https://github.com/tchandelle/angular-components-26278/blob/4d52c4d6673827731ce52eea5e88b44fedd99fd7/src/app/app.component.scss#L3
- Have a component scss in v14 like:
@use '@angular/material' as mat;
.foo {
$typo: mat.define-typography-config();
> h3 {
@include mat.typography-level($typo, subheading-2);
}
}
The component is declared as:
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'foo',
templateUrl: './foo.component.html',
styleUrls: ['./foo.component.scss'],
encapsulation: ViewEncapsulation.None,
}
- Upgrade to v15 with
npx ng update -C @angular/material@15
Expected Behavior
Should be converted to $typo: mat.define-legacy-typography-config();
Actual Behavior
Converted instead to $typo: mat.define-legacy-typography-configmat.define-legacy-typography-config();
Some are even converted to $typo: mat.define-legacy-typography-configmat.define-legacy-typography-configmat.define-legacy-typography-configmat.define-legacy-typography-configmat.define-legacy-typography-config();
.
It seems the number of repetition correlate with the number of level in the scss:
.foo {
// 1st level > repeated 2 times
$typo: mat.define-legacy-typography-configmat.define-legacy-typography-config();
.bar {
// 2nd levels > repeated 3 times
$typo: mat.define-legacy-typography-configmat.define-legacy-typography-configmat.define-legacy-typography-config();
}
}
Environment
- Angular: 15.0.4 (migrated from 14.2.10)
- CDK/Material: 15.0.3 (migrated from (14.2.7)
- Operating System (e.g. Windows, macOS, Ubuntu): darwin x64
- Node: 18.12.1
- Package Manager: yarn 3.1.1