From 45fcf24b6cb5088e3c6e08c0eff068c7a7a7b548 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sun, 1 Jun 2025 07:35:35 +0200 Subject: [PATCH 1/5] fix(material/core): brand family not set for plain value (#31260) If a non-map value is set for the `typography`, we were only setting the plain font family while the brand one was falling back to Roboto. Fixes #31254. (cherry picked from commit 8b821cbe346885ab128293aa93811e12884e8605) --- src/material/core/tokens/_m3-system.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/material/core/tokens/_m3-system.scss b/src/material/core/tokens/_m3-system.scss index 3d2df55df9c2..b1d09c9e4f53 100644 --- a/src/material/core/tokens/_m3-system.scss +++ b/src/material/core/tokens/_m3-system.scss @@ -115,6 +115,7 @@ $regular: map.get($typography, regular-weight) or $regular; } @else { $plain: $typography; + $brand: $typography; } $typography-config: ( definition.$internals: ( From 3a3a9b1c25dcca3953191f37d4f8be9b3eab5ebe Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 2 Jun 2025 20:06:33 +0200 Subject: [PATCH 2/5] fix(material/schematics): avoid overwriting files that didn't change (#31270) Fixes that the v20 update migration was overwriting all files, even if they didn't change. Fixes #31259. (cherry picked from commit 7b47e9509ab60cf9b6f15556041d3486be80ee44) --- src/material/schematics/ng-update/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/material/schematics/ng-update/index.ts b/src/material/schematics/ng-update/index.ts index 18644fe90a00..b76c9f98966b 100644 --- a/src/material/schematics/ng-update/index.ts +++ b/src/material/schematics/ng-update/index.ts @@ -59,7 +59,9 @@ function renameMdcTokens(): Rule { if (shouldRenameTokens(path)) { const content = tree.readText(path); const updatedContent = content.replace('--mdc-', '--mat-'); - tree.overwrite(path, updatedContent); + if (content !== updatedContent) { + tree.overwrite(path, updatedContent); + } } }); }; From 31f3b8bc78273eafb7fe34bb8b9f3b0c336d8902 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 3 Jun 2025 09:45:34 +0200 Subject: [PATCH 3/5] docs(material/button): variants table not rendering (#31274) Fixes that the variants that wasn't rendering, because there was no extra new line between it and the preceding paragraph. Fixes #31262. (cherry picked from commit 01ec1e0e1e0a9d62c1f7d294bc91ed9e0e3c7e7d) --- src/material/button/button.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/material/button/button.md b/src/material/button/button.md index a06348334d9e..6f9baa201c88 100644 --- a/src/material/button/button.md +++ b/src/material/button/button.md @@ -9,6 +9,7 @@ is performed. An `` element should be used whenever the user will _navigate_ There are several button variants, each applied as an attribute: + | Attribute | Description | |----------------------|--------------------------------------------------------------------------| | `matButton` | Rectangular button that can contain text and icons | From 1af07e3b220ccdc64592bee17e3b353798836699 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 3 Jun 2025 14:24:40 +0200 Subject: [PATCH 4/5] fix(material/schematics): token migration not replacing all instances (#31277) Fixes that the v20 `ng update` migration was only replacing the first instance of tokens. Fixes #31276. (cherry picked from commit eba4719157a7f9a5d4f7a169a1323fd99564f3b6) --- src/material/schematics/ng-update/index.ts | 4 +- .../test-cases/rename-mdc-tokens.spec.ts | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/material/schematics/ng-update/index.ts b/src/material/schematics/ng-update/index.ts index b76c9f98966b..1a8b2f6ab431 100644 --- a/src/material/schematics/ng-update/index.ts +++ b/src/material/schematics/ng-update/index.ts @@ -58,7 +58,7 @@ function renameMdcTokens(): Rule { tree.visit(path => { if (shouldRenameTokens(path)) { const content = tree.readText(path); - const updatedContent = content.replace('--mdc-', '--mat-'); + const updatedContent = content.replaceAll('--mdc-', '--mat-'); if (content !== updatedContent) { tree.overwrite(path, updatedContent); } @@ -100,7 +100,7 @@ function renameComponentTokens(): Rule { const content = tree.readText(path); let updatedContent = content; for (const tokenPrefix of tokenPrefixes) { - updatedContent = updatedContent.replace(tokenPrefix.old, tokenPrefix.replacement); + updatedContent = updatedContent.replaceAll(tokenPrefix.old, tokenPrefix.replacement); } if (content !== updatedContent) { tree.overwrite(path, updatedContent); diff --git a/src/material/schematics/ng-update/test-cases/rename-mdc-tokens.spec.ts b/src/material/schematics/ng-update/test-cases/rename-mdc-tokens.spec.ts index 153accbb0286..28840e5abd19 100644 --- a/src/material/schematics/ng-update/test-cases/rename-mdc-tokens.spec.ts +++ b/src/material/schematics/ng-update/test-cases/rename-mdc-tokens.spec.ts @@ -48,4 +48,58 @@ describe('v20 rename tokens migration', () => { `), ); }); + + it('should rename multiple instances of the --mdc prefix', async () => { + writeFile( + THEME_FILE_PATH, + ` + html { + --mdc-foo: 1px; + --mdc-bar: 2px; + --mdc-baz: 3px; + } + `, + ); + + await runMigration(); + + expect(stripWhitespace(tree.readText(THEME_FILE_PATH))).toBe( + stripWhitespace(` + html { + --mat-foo: 1px; + --mat-bar: 2px; + --mat-baz: 3px; + } + `), + ); + }); + + it('should rename multiple instances of a specific component token', async () => { + writeFile( + THEME_FILE_PATH, + ` + .one { + --mat-circular-progress-foo: 1px; + } + + .two { + --mat-circular-progress-bar: 2px; + } + `, + ); + + await runMigration(); + + expect(stripWhitespace(tree.readText(THEME_FILE_PATH))).toBe( + stripWhitespace(` + .one { + --mat-progress-spinner-foo: 1px; + } + + .two { + --mat-progress-spinner-bar: 2px; + } + `), + ); + }); }); From 5fa9cdf1a2be7677107a5fe87af79de218b0a7ac Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Wed, 4 Jun 2025 14:00:05 -0400 Subject: [PATCH 5/5] release: cut the v20.0.2 release --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef65a489121..0ee0d9485a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +# 20.0.2 "amesite-armoire" (2025-06-04) +### material +| Commit | Type | Description | +| -- | -- | -- | +| [45fcf24b6](https://github.com/angular/components/commit/45fcf24b6cb5088e3c6e08c0eff068c7a7a7b548) | fix | **core:** brand family not set for plain value ([#31260](https://github.com/angular/components/pull/31260)) | +| [3a3a9b1c2](https://github.com/angular/components/commit/3a3a9b1c25dcca3953191f37d4f8be9b3eab5ebe) | fix | **schematics:** avoid overwriting files that didn't change ([#31270](https://github.com/angular/components/pull/31270)) | +| [1af07e3b2](https://github.com/angular/components/commit/1af07e3b220ccdc64592bee17e3b353798836699) | fix | **schematics:** token migration not replacing all instances ([#31277](https://github.com/angular/components/pull/31277)) | + + + # 20.0.1 "sulfur-sandpaper" (2025-05-28) ### material diff --git a/package.json b/package.json index 39540f176f29..b351b20d06b4 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "ci-notify-slack-failure": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/circleci/notify-slack-job-failure.mts", "prepare": "husky" }, - "version": "20.0.1", + "version": "20.0.2", "dependencies": { "@angular-devkit/core": "catalog:", "@angular-devkit/schematics": "catalog:",