@angular/material 17.0.0-rc.1 → 17.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/_button-base.scss +37 -18
- package/button/_button-theme.scss +86 -142
- package/button/_fab-theme.scss +21 -49
- package/button/_icon-button-theme.scss +26 -25
- package/core/theming/_theming.scss +0 -14
- package/core/tokens/m2/mat/_fab.scss +87 -0
- package/core/tokens/m2/mat/_filled-button.scss +76 -0
- package/core/tokens/m2/mat/_icon-button.scss +73 -0
- package/core/tokens/m2/mat/_outlined-button.scss +73 -0
- package/core/tokens/m2/mat/_protected-button.scss +76 -0
- package/core/tokens/m2/mat/_text-button.scss +73 -0
- package/core/tokens/m2/mdc/_extended-fab.scss +3 -0
- package/core/tokens/m2/mdc/_fab.scss +17 -3
- package/core/tokens/m2/mdc/_filled-button.scss +24 -18
- package/core/tokens/m2/mdc/_icon-button.scss +0 -3
- package/core/tokens/m2/mdc/_outlined-button.scss +120 -0
- package/core/tokens/m2/mdc/_protected-button.scss +24 -19
- package/dialog/index.d.ts +2 -1
- package/esm2022/button/button.mjs +4 -4
- package/esm2022/button/fab.mjs +8 -8
- package/esm2022/button/icon-button.mjs +4 -4
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/dialog/dialog.mjs +1 -1
- package/esm2022/snack-bar/snack-bar-container.mjs +3 -3
- package/fesm2022/button.mjs +16 -16
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +2 -2
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/package.json +2 -2
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/schematics/migration.json +1 -1
- package/schematics/ng-add/fonts/material-fonts.js +1 -3
- package/schematics/ng-add/fonts/material-fonts.mjs +1 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-update/index_bundled.js +123 -30
- package/schematics/ng-update/index_bundled.js.map +4 -4
- package/button/_button-theme-private.scss +0 -67
- package/core/density/private/_compatibility.scss +0 -74
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, fab);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of icons and text projected into a FAB.
|
|
28
|
+
foreground-color: inspection.get-theme-color($theme, foreground, base),
|
|
29
|
+
|
|
30
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
31
|
+
state-layer-color: $on-surface,
|
|
32
|
+
|
|
33
|
+
// Color of the ripple element.
|
|
34
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is hovered.
|
|
37
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is focused.
|
|
40
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
41
|
+
|
|
42
|
+
// Opacity of the ripple when the button is pressed.
|
|
43
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
44
|
+
|
|
45
|
+
// MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
|
|
46
|
+
// Background color of the container when the FAB is disabled.
|
|
47
|
+
disabled-state-container-color: rgba($on-surface, 0.12),
|
|
48
|
+
|
|
49
|
+
// Color of the icons and projected text when the FAB is disabled.
|
|
50
|
+
disabled-state-foreground-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Generates the mapping for the properties that change based on the FAB palette color.
|
|
55
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
56
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
57
|
+
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
58
|
+
$contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
|
|
59
|
+
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
60
|
+
|
|
61
|
+
@return (
|
|
62
|
+
foreground-color: $color,
|
|
63
|
+
state-layer-color: $color,
|
|
64
|
+
ripple-color: rgba($color, 0.1),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
69
|
+
@function get-typography-tokens($theme) {
|
|
70
|
+
@return ();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
74
|
+
@function get-density-tokens($theme) {
|
|
75
|
+
@return ();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
79
|
+
// This is used to create token slots.
|
|
80
|
+
@function get-token-slots() {
|
|
81
|
+
@return sass-utils.deep-merge-all(
|
|
82
|
+
get-unthemable-tokens(),
|
|
83
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
84
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
85
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, filled-button);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
28
|
+
state-layer-color: $on-surface,
|
|
29
|
+
|
|
30
|
+
// Color of the ripple element.
|
|
31
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
32
|
+
|
|
33
|
+
// Opacity of the ripple when the button is hovered.
|
|
34
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is focused.
|
|
37
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is pressed.
|
|
40
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
45
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
46
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
|
+
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
48
|
+
$contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
|
|
49
|
+
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
50
|
+
|
|
51
|
+
@return (
|
|
52
|
+
state-layer-color: $color,
|
|
53
|
+
ripple-color: rgba($color, 0.1),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
58
|
+
@function get-typography-tokens($theme) {
|
|
59
|
+
@return ();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
63
|
+
@function get-density-tokens($theme) {
|
|
64
|
+
@return ();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
68
|
+
// This is used to create token slots.
|
|
69
|
+
@function get-token-slots() {
|
|
70
|
+
@return sass-utils.deep-merge-all(
|
|
71
|
+
get-unthemable-tokens(),
|
|
72
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
73
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
74
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, icon-button);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
28
|
+
state-layer-color: $on-surface,
|
|
29
|
+
|
|
30
|
+
// Color of the ripple element.
|
|
31
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
32
|
+
|
|
33
|
+
// Opacity of the ripple when the button is hovered.
|
|
34
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is focused.
|
|
37
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is pressed.
|
|
40
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
45
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
46
|
+
$color: inspection.get-theme-color($theme, $palette-name);
|
|
47
|
+
|
|
48
|
+
@return (
|
|
49
|
+
state-layer-color: $color,
|
|
50
|
+
ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
55
|
+
@function get-typography-tokens($theme) {
|
|
56
|
+
@return ();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
60
|
+
@function get-density-tokens($theme) {
|
|
61
|
+
@return ();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
65
|
+
// This is used to create token slots.
|
|
66
|
+
@function get-token-slots() {
|
|
67
|
+
@return sass-utils.deep-merge-all(
|
|
68
|
+
get-unthemable-tokens(),
|
|
69
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
70
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
71
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, outlined-button);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
28
|
+
state-layer-color: $on-surface,
|
|
29
|
+
|
|
30
|
+
// Color of the ripple element.
|
|
31
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
32
|
+
|
|
33
|
+
// Opacity of the ripple when the button is hovered.
|
|
34
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is focused.
|
|
37
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is pressed.
|
|
40
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
45
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
46
|
+
$color: inspection.get-theme-color($theme, $palette-name);
|
|
47
|
+
|
|
48
|
+
@return (
|
|
49
|
+
state-layer-color: $color,
|
|
50
|
+
ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
55
|
+
@function get-typography-tokens($theme) {
|
|
56
|
+
@return ();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
60
|
+
@function get-density-tokens($theme) {
|
|
61
|
+
@return ();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
65
|
+
// This is used to create token slots.
|
|
66
|
+
@function get-token-slots() {
|
|
67
|
+
@return sass-utils.deep-merge-all(
|
|
68
|
+
get-unthemable-tokens(),
|
|
69
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
70
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
71
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
3
|
+
@use '../../token-utils';
|
|
4
|
+
@use '../../../theming/inspection';
|
|
5
|
+
@use '../../../style/sass-utils';
|
|
6
|
+
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, protected-button);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
28
|
+
state-layer-color: $on-surface,
|
|
29
|
+
|
|
30
|
+
// Color of the ripple element.
|
|
31
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
32
|
+
|
|
33
|
+
// Opacity of the ripple when the button is hovered.
|
|
34
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is focused.
|
|
37
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is pressed.
|
|
40
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
45
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
46
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
47
|
+
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
48
|
+
$contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
|
|
49
|
+
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
50
|
+
|
|
51
|
+
@return (
|
|
52
|
+
state-layer-color: $color,
|
|
53
|
+
ripple-color: rgba($color, 0.1),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
58
|
+
@function get-typography-tokens($theme) {
|
|
59
|
+
@return ();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
63
|
+
@function get-density-tokens($theme) {
|
|
64
|
+
@return ();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
68
|
+
// This is used to create token slots.
|
|
69
|
+
@function get-token-slots() {
|
|
70
|
+
@return sass-utils.deep-merge-all(
|
|
71
|
+
get-unthemable-tokens(),
|
|
72
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
73
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
74
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '../../../theming/inspection';
|
|
6
|
+
@use '../../../style/sass-utils';
|
|
7
|
+
|
|
8
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
|
+
$prefix: (mat, text-button);
|
|
10
|
+
|
|
11
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
12
|
+
// but may be in a future version of the theming API.
|
|
13
|
+
@function get-unthemable-tokens() {
|
|
14
|
+
@return ();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
18
|
+
@function get-color-tokens($theme) {
|
|
19
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
20
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
21
|
+
$ripple-opacities: if($is-dark,
|
|
22
|
+
mdc-ripple-theme.$light-ink-opacities,
|
|
23
|
+
mdc-ripple-theme.$dark-ink-opacities
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@return (
|
|
27
|
+
// Color of the element that shows the hover, focus and pressed states.
|
|
28
|
+
state-layer-color: $on-surface,
|
|
29
|
+
|
|
30
|
+
// Color of the ripple element.
|
|
31
|
+
ripple-color: rgba($on-surface, 0.1),
|
|
32
|
+
|
|
33
|
+
// Opacity of the ripple when the button is hovered.
|
|
34
|
+
hover-state-layer-opacity: map.get($ripple-opacities, hover),
|
|
35
|
+
|
|
36
|
+
// Opacity of the ripple when the button is focused.
|
|
37
|
+
focus-state-layer-opacity: map.get($ripple-opacities, focus),
|
|
38
|
+
|
|
39
|
+
// Opacity of the ripple when the button is pressed.
|
|
40
|
+
pressed-state-layer-opacity: map.get($ripple-opacities, press),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
45
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
46
|
+
$color: inspection.get-theme-color($theme, $palette-name);
|
|
47
|
+
|
|
48
|
+
@return (
|
|
49
|
+
state-layer-color: $color,
|
|
50
|
+
ripple-color: if(meta.type-of($color) == color, rgba($color, 0.1), $color),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
55
|
+
@function get-typography-tokens($theme) {
|
|
56
|
+
@return ();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
60
|
+
@function get-density-tokens($theme) {
|
|
61
|
+
@return ();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
65
|
+
// This is used to create token slots.
|
|
66
|
+
@function get-token-slots() {
|
|
67
|
+
@return sass-utils.deep-merge-all(
|
|
68
|
+
get-unthemable-tokens(),
|
|
69
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
70
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
71
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -8,6 +8,9 @@ $prefix: (mdc, extended-fab);
|
|
|
8
8
|
|
|
9
9
|
@function get-unthemable-tokens() {
|
|
10
10
|
@return (
|
|
11
|
+
// =============================================================================================
|
|
12
|
+
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
13
|
+
// =============================================================================================
|
|
11
14
|
container-color: null,
|
|
12
15
|
container-elevation: null,
|
|
13
16
|
container-height: null,
|
|
@@ -22,6 +22,13 @@ $ripple-target: '.mdc-fab__ripple';
|
|
|
22
22
|
container-shape: 50%,
|
|
23
23
|
icon-size: 24px,
|
|
24
24
|
|
|
25
|
+
// We don't use this token, because it doesn't set the color of any text inside the FAB.
|
|
26
|
+
// We create a custom token for it instead.
|
|
27
|
+
icon-color: null,
|
|
28
|
+
|
|
29
|
+
// =============================================================================================
|
|
30
|
+
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
31
|
+
// =============================================================================================
|
|
25
32
|
container-elevation: null,
|
|
26
33
|
container-height: null,
|
|
27
34
|
container-shadow-color: null,
|
|
@@ -56,10 +63,17 @@ $ripple-target: '.mdc-fab__ripple';
|
|
|
56
63
|
|
|
57
64
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
58
65
|
@function get-color-tokens($theme) {
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
@return (
|
|
67
|
+
// Background color of the FAB.
|
|
68
|
+
container-color: inspection.get-theme-color($theme, background, card),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
61
71
|
|
|
62
|
-
|
|
72
|
+
// Generates the mapping for the properties that change based on the FAB palette color.
|
|
73
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
74
|
+
@return (
|
|
75
|
+
container-color: inspection.get-theme-color($theme, $palette-name, default),
|
|
76
|
+
);
|
|
63
77
|
}
|
|
64
78
|
|
|
65
79
|
// Tokens that can be configured through Angular Material's typography theming API.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../../token-utils';
|
|
3
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
4
3
|
@use '../../../style/sass-utils';
|
|
5
4
|
@use '../../../theming/inspection';
|
|
6
5
|
@use '../../../theming/theming';
|
|
6
|
+
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
7
|
|
|
8
8
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
9
|
$prefix: (mdc, filled-button);
|
|
@@ -24,6 +24,9 @@ $prefix: (mdc, filled-button);
|
|
|
24
24
|
keep-touch-target: false,
|
|
25
25
|
pressed-container-elevation: 0,
|
|
26
26
|
|
|
27
|
+
// =============================================================================================
|
|
28
|
+
// = TOKENS NOT USED IN ANGULAR MATERIAL =
|
|
29
|
+
// =============================================================================================
|
|
27
30
|
focus-ring-color: null,
|
|
28
31
|
focus-ring-offset: null,
|
|
29
32
|
focus-state-layer-opacity: null,
|
|
@@ -43,33 +46,36 @@ $prefix: (mdc, filled-button);
|
|
|
43
46
|
with-icon-hover-icon-color: null,
|
|
44
47
|
with-icon-icon-color: null,
|
|
45
48
|
with-icon-icon-size: null,
|
|
46
|
-
with-icon-pressed-icon-color: null
|
|
49
|
+
with-icon-pressed-icon-color: null,
|
|
50
|
+
focus-state-layer-color: null,
|
|
51
|
+
hover-state-layer-color: null,
|
|
52
|
+
pressed-state-layer-color: null,
|
|
47
53
|
);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
|
-
@function _on-color($theme, $palette) {
|
|
51
|
-
@if ($palette) {
|
|
52
|
-
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
53
|
-
@return if(mdc-helpers.variable-safe-contrast-tone($palette, $is-dark) == 'dark', #000, #fff);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
56
|
// Tokens that can be configured through Angular Material's color theming API.
|
|
58
|
-
@function get-color-tokens($theme
|
|
57
|
+
@function get-color-tokens($theme) {
|
|
59
58
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
60
|
-
$primary: inspection.get-theme-color($theme, primary);
|
|
61
59
|
$surface: inspection.get-theme-color($theme, background, card);
|
|
62
|
-
$on-
|
|
63
|
-
$on-surface: _on-color($theme, $surface);
|
|
60
|
+
$on-surface: if($is-dark, #fff, #000);
|
|
64
61
|
|
|
65
62
|
@return (
|
|
66
|
-
container-color:
|
|
63
|
+
container-color: $surface,
|
|
64
|
+
label-text-color: $on-surface,
|
|
67
65
|
disabled-container-color: rgba($on-surface, 0.12),
|
|
68
66
|
disabled-label-text-color: rgba($on-surface, if($is-dark, 0.5, 0.38)),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Generates the mapping for the properties that change based on the button palette color.
|
|
71
|
+
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
72
|
+
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
73
|
+
$container-color: inspection.get-theme-color($theme, $palette-name, default);
|
|
74
|
+
$contrast-tone: mdc-helpers.variable-safe-contrast-tone($container-color, $is-dark);
|
|
75
|
+
|
|
76
|
+
@return (
|
|
77
|
+
container-color: $container-color,
|
|
78
|
+
label-text-color: if($contrast-tone == 'dark', #000, #fff),
|
|
73
79
|
);
|
|
74
80
|
}
|
|
75
81
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
1
|
@use '../../../style/sass-utils';
|
|
3
2
|
@use '../../../theming/inspection';
|
|
4
3
|
@use '../../token-utils';
|
|
@@ -57,8 +56,6 @@ $prefix: (mdc, icon-button);
|
|
|
57
56
|
|
|
58
57
|
// Generates the mapping for the properties that change based on the button palette color.
|
|
59
58
|
@function private-get-color-palette-color-tokens($theme, $palette-name) {
|
|
60
|
-
$palette: map.get($theme, $palette-name);
|
|
61
|
-
|
|
62
59
|
@return (
|
|
63
60
|
icon-color: inspection.get-theme-color($theme, $palette-name)
|
|
64
61
|
);
|