File tree Expand file tree Collapse file tree 7 files changed +14
-15
lines changed
material-experimental/theming-next Expand file tree Collapse file tree 7 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ sass_binary(
116
116
)
117
117
118
118
sass_binary (
119
- name = "theme_token_api " ,
120
- src = "theme-token-api .scss" ,
119
+ name = "theme_m3 " ,
120
+ src = "theme-m3 .scss" ,
121
121
deps = [
122
122
"//src/material:sass_lib" ,
123
123
"//src/material-experimental:sass_lib" ,
@@ -142,7 +142,7 @@ filegroup(
142
142
"favicon.ico" ,
143
143
"index.html" ,
144
144
":theme" ,
145
- ":theme_token_api " ,
145
+ ":theme_m3 " ,
146
146
":variables" ,
147
147
"//src/dev-app/icon:icon_demo_assets" ,
148
148
"@npm//:node_modules/moment/min/moment-with-locales.min.js" ,
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ <h1>Angular Material Demos</h1>
53
53
</ button >
54
54
< button
55
55
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 ' ">
58
58
< mat-icon > brush</ mat-icon >
59
59
</ button >
60
60
< button
Original file line number Diff line number Diff line change @@ -162,13 +162,13 @@ export class DevAppLayout {
162
162
}
163
163
}
164
164
165
- toggleTokens ( value = ! this . state . tokensEnabled ) {
165
+ toggleM3 ( value = ! this . state . m3Enabled ) {
166
166
// 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 ) {
168
168
( document . getElementById ( 'theme-styles' ) as HTMLLinkElement ) . href = value
169
- ? 'theme-token-api .css'
169
+ ? 'theme-m3 .css'
170
170
: 'theme.css' ;
171
- this . state . tokensEnabled = value ;
171
+ this . state . m3Enabled = value ;
172
172
setAppState ( this . state ) ;
173
173
}
174
174
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export interface DevAppState {
17
17
darkTheme : boolean ;
18
18
rippleDisabled : boolean ;
19
19
strongFocusEnabled : boolean ;
20
- tokensEnabled : boolean ;
20
+ m3Enabled : boolean ;
21
21
direction : Direction ;
22
22
}
23
23
@@ -41,7 +41,7 @@ export function getAppState(): DevAppState {
41
41
darkTheme : false ,
42
42
rippleDisabled : false ,
43
43
strongFocusEnabled : false ,
44
- tokensEnabled : false ,
44
+ m3Enabled : false ,
45
45
direction : 'ltr' ,
46
46
} ;
47
47
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import {getAppState} from './dev-app/dev-app-state';
29
29
// It uses a different file, instead of toggling a class, to avoid other styles from bleeding in.
30
30
const cachedAppState = getAppState ( ) ;
31
31
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' ;
33
33
theme . id = 'theme-styles' ;
34
34
theme . rel = 'stylesheet' ;
35
35
document . head . appendChild ( theme ) ;
Original file line number Diff line number Diff line change 2
2
@use ' @angular/material' as mat ;
3
3
@use ' @angular/material-experimental' as matx ;
4
4
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 .
6
6
dev-app {
7
7
& ::before {
8
- content : ' Using experimental theming API ' ;
8
+ content : ' Using experimental M3 theme, only components that support M3 will work ' ;
9
9
display : inline-block ;
10
10
position : fixed ;
11
11
z-index : 100 ;
Original file line number Diff line number Diff line change @@ -55,4 +55,3 @@ $m2-tokens: mat.m2-tokens-from-theme($my-theme);
55
55
need to appear differently, say within ` .dark-sidebar ` , set the token overrides on the
56
56
` .dark-sidebar ` element and they will be inherited down to the checkboxes within, instead of the
57
57
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
You can’t perform that action at this time.
0 commit comments