Skip to content

Commit ae80455

Browse files
committed
build: rename the m3 theme file
Rename the m3 theme file to make its purpose more clear. Also change some related text in the dev-app.
1 parent f11ecb3 commit ae80455

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

src/dev-app/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ sass_binary(
116116
)
117117

118118
sass_binary(
119-
name = "theme_token_api",
120-
src = "theme-token-api.scss",
119+
name = "theme_m3",
120+
src = "theme-m3.scss",
121121
deps = [
122122
"//src/material:sass_lib",
123123
"//src/material-experimental:sass_lib",
@@ -142,7 +142,7 @@ filegroup(
142142
"favicon.ico",
143143
"index.html",
144144
":theme",
145-
":theme_token_api",
145+
":theme_m3",
146146
":variables",
147147
"//src/dev-app/icon:icon_demo_assets",
148148
"@npm//:node_modules/moment/min/moment-with-locales.min.js",

src/dev-app/dev-app/dev-app-layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ <h1>Angular Material Demos</h1>
5353
</button>
5454
<button
5555
mat-icon-button
56-
(click)="toggleTokens()"
57-
[matTooltip]="state.tokensEnabled ? 'Disable tokens' : 'Enable tokens'">
56+
(click)="toggleM3()"
57+
[matTooltip]="state.m3Enabled ? 'Use M2 theme' : 'Use M3 theme'">
5858
<mat-icon>brush</mat-icon>
5959
</button>
6060
<button

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ export class DevAppLayout {
162162
}
163163
}
164164

165-
toggleTokens(value = !this.state.tokensEnabled) {
165+
toggleM3(value = !this.state.m3Enabled) {
166166
// We need to diff this one since it's a bit more expensive to toggle.
167-
if (value !== this.state.tokensEnabled) {
167+
if (value !== this.state.m3Enabled) {
168168
(document.getElementById('theme-styles') as HTMLLinkElement).href = value
169-
? 'theme-token-api.css'
169+
? 'theme-m3.css'
170170
: 'theme.css';
171-
this.state.tokensEnabled = value;
171+
this.state.m3Enabled = value;
172172
setAppState(this.state);
173173
}
174174
}

src/dev-app/dev-app/dev-app-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface DevAppState {
1717
darkTheme: boolean;
1818
rippleDisabled: boolean;
1919
strongFocusEnabled: boolean;
20-
tokensEnabled: boolean;
20+
m3Enabled: boolean;
2121
direction: Direction;
2222
}
2323

@@ -41,7 +41,7 @@ export function getAppState(): DevAppState {
4141
darkTheme: false,
4242
rippleDisabled: false,
4343
strongFocusEnabled: false,
44-
tokensEnabled: false,
44+
m3Enabled: false,
4545
direction: 'ltr',
4646
};
4747

src/dev-app/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {getAppState} from './dev-app/dev-app-state';
2929
// It uses a different file, instead of toggling a class, to avoid other styles from bleeding in.
3030
const cachedAppState = getAppState();
3131
const theme = document.createElement('link');
32-
theme.href = cachedAppState.tokensEnabled ? 'theme-token-api.css' : 'theme.css';
32+
theme.href = cachedAppState.m3Enabled ? 'theme-m3.css' : 'theme.css';
3333
theme.id = 'theme-styles';
3434
theme.rel = 'stylesheet';
3535
document.head.appendChild(theme);

src/dev-app/theme-token-api.scss renamed to src/dev-app/theme-m3.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
@use '@angular/material' as mat;
33
@use '@angular/material-experimental' as matx;
44

5-
// Add an indicator to make it clear that the app is styled with the experimental theming API.
5+
// Add an indicator to make it clear that the app is styled with the experimental M3 theme.
66
dev-app {
77
&::before {
8-
content: 'Using experimental theming API';
8+
content: 'Using experimental M3 theme, only components that support M3 will work';
99
display: inline-block;
1010
position: fixed;
1111
z-index: 100;

src/material-experimental/theming-next/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ $m2-tokens: mat.m2-tokens-from-theme($my-theme);
5555
need to appear differently, say within `.dark-sidebar`, set the token overrides on the
5656
`.dark-sidebar` element and they will be inherited down to the checkboxes within, instead of the
5757
values from the root element.
58-
- For a small example, see this [alternate partial theme](https://github.com/angular/components/blob/main/src/dev-app/theme-token-api.scss) for the dev-app

0 commit comments

Comments
 (0)