@angular/material 18.1.1 → 18.1.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 +0 -6
- package/core/_core.scss +15 -18
- package/core/m2/_typography.scss +129 -2
- package/core/style/_elevation.scss +116 -27
- package/core/tokens/_m3-tokens.scss +13 -13
- package/core/tokens/_token-utils.scss +65 -2
- package/core/tokens/m2/mat/_fab-small.scss +1 -2
- package/core/tokens/m2/mat/_fab.scss +1 -2
- package/core/tokens/m2/mat/_filled-button.scss +1 -2
- package/core/tokens/m2/mat/_form-field.scss +0 -2
- package/core/tokens/m2/mat/_protected-button.scss +1 -2
- package/core/tokens/m2/mdc/_checkbox.scss +1 -2
- package/core/tokens/m2/mdc/_filled-button.scss +1 -2
- package/core/tokens/m2/mdc/_protected-button.scss +1 -2
- package/core/tokens/m3/definitions/_index.scss +94 -0
- package/core/tokens/m3/definitions/_md-comp-checkbox.scss +120 -0
- package/core/tokens/m3/definitions/_md-comp-circular-progress-indicator.scss +27 -0
- package/core/tokens/m3/definitions/_md-comp-data-table.scss +90 -0
- package/core/tokens/m3/definitions/_md-comp-dialog.scss +123 -0
- package/core/tokens/m3/definitions/_md-comp-elevated-button.scss +87 -0
- package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +53 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-primary.scss +90 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-secondary.scss +91 -0
- package/core/tokens/m3/definitions/_md-comp-extended-fab-tertiary.scss +91 -0
- package/core/tokens/m3/definitions/_md-comp-fab-primary-small.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-fab-primary.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-fab-secondary-small.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-secondary.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-tertiary-small.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-fab-tertiary.scss +60 -0
- package/core/tokens/m3/definitions/_md-comp-filled-button.scss +85 -0
- package/core/tokens/m3/definitions/_md-comp-filled-card.scss +52 -0
- package/core/tokens/m3/definitions/_md-comp-filled-icon-button.scss +73 -0
- package/core/tokens/m3/definitions/_md-comp-filled-text-field.scss +189 -0
- package/core/tokens/m3/definitions/_md-comp-icon-button.scss +64 -0
- package/core/tokens/m3/definitions/_md-comp-linear-progress-indicator.scss +29 -0
- package/core/tokens/m3/definitions/_md-comp-list.scss +252 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-button.scss +80 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-card.scss +59 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-icon-button.scss +73 -0
- package/core/tokens/m3/definitions/_md-comp-outlined-text-field.scss +171 -0
- package/core/tokens/m3/definitions/_md-comp-plain-tooltip.scss +51 -0
- package/core/tokens/m3/definitions/_md-comp-radio-button.scss +62 -0
- package/core/tokens/m3/definitions/_md-comp-secondary-navigation-tab.scss +80 -0
- package/core/tokens/m3/definitions/_md-comp-slider.scss +110 -0
- package/core/tokens/m3/definitions/_md-comp-snackbar.scss +125 -0
- package/core/tokens/m3/definitions/_md-comp-switch.scss +130 -0
- package/core/tokens/m3/definitions/_md-comp-text-button.scss +73 -0
- package/core/tokens/m3/definitions/_md-ref-palette.scss +100 -0
- package/core/tokens/m3/definitions/_md-ref-typeface.scss +14 -0
- package/core/tokens/m3/definitions/_md-sys-color.scss +126 -0
- package/core/tokens/m3/definitions/_md-sys-elevation.scss +15 -0
- package/core/tokens/m3/definitions/_md-sys-motion.scss +46 -0
- package/core/tokens/m3/definitions/_md-sys-shape.scss +24 -0
- package/core/tokens/m3/definitions/_md-sys-state.scss +13 -0
- package/core/tokens/m3/definitions/_md-sys-typescale.scss +308 -0
- package/core/tokens/m3/definitions/unused/_md-comp-assist-chip.scss +105 -0
- package/core/tokens/m3/definitions/unused/_md-comp-badge.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-banner.scss +71 -0
- package/core/tokens/m3/definitions/unused/_md-comp-bottom-app-bar.scss +29 -0
- package/core/tokens/m3/definitions/unused/_md-comp-carousel-item.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-input-modal.scss +87 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-picker-docked.scss +248 -0
- package/core/tokens/m3/definitions/unused/_md-comp-date-picker-modal.scss +313 -0
- package/core/tokens/m3/definitions/unused/_md-comp-divider.scss +19 -0
- package/core/tokens/m3/definitions/unused/_md-comp-extended-fab-branded.scss +82 -0
- package/core/tokens/m3/definitions/unused/_md-comp-extended-fab-surface.scss +86 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-branded-large.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-branded.scss +54 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-primary-large.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-secondary-large.scss +60 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface-large.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface-small.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-surface.scss +58 -0
- package/core/tokens/m3/definitions/unused/_md-comp-fab-tertiary-large.scss +60 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-autocomplete.scss +269 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-menu-button.scss +94 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-select.scss +274 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-tonal-button.scss +95 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filled-tonal-icon-button.scss +80 -0
- package/core/tokens/m3/definitions/unused/_md-comp-filter-chip.scss +205 -0
- package/core/tokens/m3/definitions/unused/_md-comp-full-screen-dialog.scss +109 -0
- package/core/tokens/m3/definitions/unused/_md-comp-input-chip.scss +180 -0
- package/core/tokens/m3/definitions/unused/_md-comp-menu.scss +31 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-bar.scss +110 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-drawer.scss +162 -0
- package/core/tokens/m3/definitions/unused/_md-comp-navigation-rail.scss +127 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-autocomplete.scss +259 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-menu-button.scss +90 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-segmented-button.scss +108 -0
- package/core/tokens/m3/definitions/unused/_md-comp-outlined-select.scss +264 -0
- package/core/tokens/m3/definitions/unused/_md-comp-primary-navigation-tab.scss +117 -0
- package/core/tokens/m3/definitions/unused/_md-comp-rich-tooltip.scss +121 -0
- package/core/tokens/m3/definitions/unused/_md-comp-scrim.scss +19 -0
- package/core/tokens/m3/definitions/unused/_md-comp-search-bar.scss +97 -0
- package/core/tokens/m3/definitions/unused/_md-comp-search-view.scss +91 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-bottom.scss +39 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-floating.scss +28 -0
- package/core/tokens/m3/definitions/unused/_md-comp-sheet-side.scss +87 -0
- package/core/tokens/m3/definitions/unused/_md-comp-standard-menu-button.scss +94 -0
- package/core/tokens/m3/definitions/unused/_md-comp-suggestion-chip.scss +121 -0
- package/core/tokens/m3/definitions/unused/_md-comp-time-input.scss +222 -0
- package/core/tokens/m3/definitions/unused/_md-comp-time-picker.scss +268 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-large.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-medium.scss +59 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-small-centered.scss +62 -0
- package/core/tokens/m3/definitions/unused/_md-comp-top-app-bar-small.scss +60 -0
- package/esm2022/autocomplete/animations.mjs +1 -2
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/dialog/dialog-container.mjs +1 -4
- package/esm2022/form-field/form-field.mjs +4 -1
- package/esm2022/input/input.mjs +36 -3
- package/esm2022/list/testing/selection-list-harness.mjs +2 -2
- package/esm2022/tabs/testing/tab-harness.mjs +2 -2
- package/fesm2022/autocomplete.mjs +0 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/dialog.mjs +0 -3
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/form-field.mjs +3 -0
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/input.mjs +35 -2
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/form-field/_form-field-focus-overlay.scss +1 -1
- package/input/index.d.ts +13 -1
- package/list/testing/index.d.ts +1 -1
- package/package.json +3 -51
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/m3-theme/index_bundled.js +2 -2
- package/schematics/ng-update/index_bundled.js +31 -31
- package/tabs/testing/index.d.ts +1 -1
- package/core/mdc-helpers/_mdc-helpers.scss +0 -60
package/button/_button-base.scss
CHANGED
|
@@ -116,12 +116,6 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
@mixin mat-private-button-touch-target($is-square, $prefix, $slots) {
|
|
119
|
-
// Element used to ensure that the button has a touch target that meets the required minimum.
|
|
120
|
-
// Note that we use this, instead of MDC's built-in `mdc-button--touch` class, because the MDC
|
|
121
|
-
// class is implemented as `margin-top: 6px; margin-bottom: 6px` on the host element which
|
|
122
|
-
// goes against our rule of not having margins on the host node. Furthermore, having the margin on
|
|
123
|
-
// the button itself would require us to wrap it in another div. See:
|
|
124
|
-
// https://github.com/material-components/material-components-web/tree/master/packages/mdc-button#making-buttons-accessible
|
|
125
119
|
.mat-mdc-button-touch-target {
|
|
126
120
|
position: absolute;
|
|
127
121
|
top: 50%;
|
package/core/_core.scss
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@use './ripple/ripple';
|
|
5
5
|
@use './style/elevation';
|
|
6
6
|
@use './focus-indicators/private';
|
|
7
|
-
@use './mdc-helpers/mdc-helpers';
|
|
8
7
|
|
|
9
8
|
// Mixin that renders all of the core styles that are not theme-dependent.
|
|
10
9
|
@mixin core() {
|
|
@@ -20,24 +19,22 @@
|
|
|
20
19
|
// user's content isn't inside of a `mat-sidenav-container`.
|
|
21
20
|
@at-root {
|
|
22
21
|
// Note: we need to emit fallback values here to avoid errors in internal builds.
|
|
23
|
-
@include
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
22
|
+
@include token-utils.use-tokens(tokens-mat-app.$prefix, tokens-mat-app.get-token-slots()) {
|
|
23
|
+
.mat-app-background {
|
|
24
|
+
@include token-utils.create-token-slot(background-color, background-color, transparent);
|
|
25
|
+
@include token-utils.create-token-slot(color, text-color, inherit);
|
|
26
|
+
}
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
28
|
+
// Provides external CSS classes for each elevation value. Each CSS class is formatted as
|
|
29
|
+
// `mat-elevation-z$z-value` where `$z-value` corresponds to the z-space to which the element
|
|
30
|
+
// is elevated.
|
|
31
|
+
@for $z-value from 0 through 24 {
|
|
32
|
+
$selector: elevation.$prefix + $z-value;
|
|
33
|
+
// We need the `mat-mdc-elevation-specific`, because some MDC mixins
|
|
34
|
+
// come with elevation baked in and we don't have a way of removing it.
|
|
35
|
+
.#{$selector}, .mat-mdc-elevation-specific.#{$selector} {
|
|
36
|
+
@include token-utils.create-token-slot(box-shadow, 'elevation-shadow-level-#{$z-value}',
|
|
37
|
+
none);
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
package/core/m2/_typography.scss
CHANGED
|
@@ -2,10 +2,137 @@
|
|
|
2
2
|
@use 'sass:math';
|
|
3
3
|
@use 'sass:meta';
|
|
4
4
|
@use 'sass:string';
|
|
5
|
-
@use '@material/typography' as mdc-typography;
|
|
6
5
|
|
|
7
6
|
$_default-font-family: string.unquote('Roboto, sans-serif');
|
|
8
7
|
|
|
8
|
+
@function _px-to-rem($px) {
|
|
9
|
+
@return math.div($px, 16px) * 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@function _get-letter-spacing($tracking, $font-size) {
|
|
13
|
+
@return math.div($tracking, $font-size * 16) * 1em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$_mdc-levels: (
|
|
17
|
+
headline1: (
|
|
18
|
+
font-family: $_default-font-family,
|
|
19
|
+
font-size: _px-to-rem(96px),
|
|
20
|
+
line-height: _px-to-rem(96px),
|
|
21
|
+
font-weight: 300,
|
|
22
|
+
letter-spacing: _get-letter-spacing(-1.5, 6),
|
|
23
|
+
text-decoration: inherit,
|
|
24
|
+
text-transform: inherit,
|
|
25
|
+
),
|
|
26
|
+
headline2: (
|
|
27
|
+
font-family: $_default-font-family,
|
|
28
|
+
font-size: _px-to-rem(60px),
|
|
29
|
+
line-height: _px-to-rem(60px),
|
|
30
|
+
font-weight: 300,
|
|
31
|
+
letter-spacing: _get-letter-spacing(-0.5, 3.75),
|
|
32
|
+
text-decoration: inherit,
|
|
33
|
+
text-transform: inherit,
|
|
34
|
+
),
|
|
35
|
+
headline3: (
|
|
36
|
+
font-family: $_default-font-family,
|
|
37
|
+
font-size: _px-to-rem(48px),
|
|
38
|
+
line-height: _px-to-rem(50px),
|
|
39
|
+
font-weight: 400,
|
|
40
|
+
letter-spacing: normal,
|
|
41
|
+
text-decoration: inherit,
|
|
42
|
+
text-transform: inherit,
|
|
43
|
+
),
|
|
44
|
+
headline4: (
|
|
45
|
+
font-family: $_default-font-family,
|
|
46
|
+
font-size: _px-to-rem(34px),
|
|
47
|
+
line-height: _px-to-rem(40px),
|
|
48
|
+
font-weight: 400,
|
|
49
|
+
letter-spacing: _get-letter-spacing(0.25, 2.125),
|
|
50
|
+
text-decoration: inherit,
|
|
51
|
+
text-transform: inherit,
|
|
52
|
+
),
|
|
53
|
+
headline5: (
|
|
54
|
+
font-family: $_default-font-family,
|
|
55
|
+
font-size: _px-to-rem(24px),
|
|
56
|
+
line-height: _px-to-rem(32px),
|
|
57
|
+
font-weight: 400,
|
|
58
|
+
letter-spacing: normal,
|
|
59
|
+
text-decoration: inherit,
|
|
60
|
+
text-transform: inherit,
|
|
61
|
+
),
|
|
62
|
+
headline6: (
|
|
63
|
+
font-family: $_default-font-family,
|
|
64
|
+
font-size: _px-to-rem(20px),
|
|
65
|
+
line-height: _px-to-rem(32px),
|
|
66
|
+
font-weight: 500,
|
|
67
|
+
letter-spacing: _get-letter-spacing(0.25, 1.25),
|
|
68
|
+
text-decoration: inherit,
|
|
69
|
+
text-transform: inherit,
|
|
70
|
+
),
|
|
71
|
+
subtitle1: (
|
|
72
|
+
font-family: $_default-font-family,
|
|
73
|
+
font-size: _px-to-rem(16px),
|
|
74
|
+
line-height: _px-to-rem(28px),
|
|
75
|
+
font-weight: 400,
|
|
76
|
+
letter-spacing: _get-letter-spacing(0.15, 1),
|
|
77
|
+
text-decoration: inherit,
|
|
78
|
+
text-transform: inherit,
|
|
79
|
+
),
|
|
80
|
+
subtitle2: (
|
|
81
|
+
font-family: $_default-font-family,
|
|
82
|
+
font-size: _px-to-rem(14px),
|
|
83
|
+
line-height: _px-to-rem(22px),
|
|
84
|
+
font-weight: 500,
|
|
85
|
+
letter-spacing: _get-letter-spacing(0.1, 0.875),
|
|
86
|
+
text-decoration: inherit,
|
|
87
|
+
text-transform: inherit,
|
|
88
|
+
),
|
|
89
|
+
body1: (
|
|
90
|
+
font-family: $_default-font-family,
|
|
91
|
+
font-size: _px-to-rem(16px),
|
|
92
|
+
line-height: _px-to-rem(24px),
|
|
93
|
+
font-weight: 400,
|
|
94
|
+
letter-spacing: _get-letter-spacing(0.5, 1),
|
|
95
|
+
text-decoration: inherit,
|
|
96
|
+
text-transform: inherit,
|
|
97
|
+
),
|
|
98
|
+
body2: (
|
|
99
|
+
font-family: $_default-font-family,
|
|
100
|
+
font-size: _px-to-rem(14px),
|
|
101
|
+
line-height: _px-to-rem(20px),
|
|
102
|
+
font-weight: 400,
|
|
103
|
+
letter-spacing: _get-letter-spacing(0.25, 0.875),
|
|
104
|
+
text-decoration: inherit,
|
|
105
|
+
text-transform: inherit,
|
|
106
|
+
),
|
|
107
|
+
caption: (
|
|
108
|
+
font-family: $_default-font-family,
|
|
109
|
+
font-size: _px-to-rem(12px),
|
|
110
|
+
line-height: _px-to-rem(20px),
|
|
111
|
+
font-weight: 400,
|
|
112
|
+
letter-spacing: _get-letter-spacing(0.4, 0.75),
|
|
113
|
+
text-decoration: inherit,
|
|
114
|
+
text-transform: inherit,
|
|
115
|
+
),
|
|
116
|
+
button: (
|
|
117
|
+
font-family: $_default-font-family,
|
|
118
|
+
font-size: _px-to-rem(14px),
|
|
119
|
+
line-height: _px-to-rem(36px),
|
|
120
|
+
font-weight: 500,
|
|
121
|
+
letter-spacing: _get-letter-spacing(1.25, 0.875),
|
|
122
|
+
text-decoration: none,
|
|
123
|
+
text-transform: uppercase,
|
|
124
|
+
),
|
|
125
|
+
overline: (
|
|
126
|
+
font-family: $_default-font-family,
|
|
127
|
+
font-size: _px-to-rem(12px),
|
|
128
|
+
line-height: _px-to-rem(32px),
|
|
129
|
+
font-weight: 500,
|
|
130
|
+
letter-spacing: _get-letter-spacing(2, 0.75),
|
|
131
|
+
text-decoration: none,
|
|
132
|
+
text-transform: uppercase,
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
|
|
9
136
|
/// Defines a typography level from the Material Design spec.
|
|
10
137
|
/// @param {String} $font-size The font-size for this level.
|
|
11
138
|
/// @param {String | Number} $line-height The line-height for this level.
|
|
@@ -217,7 +344,7 @@ $_default-font-family: string.unquote('Roboto, sans-serif');
|
|
|
217
344
|
|
|
218
345
|
// Converts an MDC typography level config to an Angular Material one.
|
|
219
346
|
@function typography-config-level-from-mdc($mdc-level, $font-family: null) {
|
|
220
|
-
$mdc-level-config: map.get(
|
|
347
|
+
$mdc-level-config: map.get($_mdc-levels, $mdc-level);
|
|
221
348
|
|
|
222
349
|
// Explicitly default the font family to null since we'll apply it globally
|
|
223
350
|
// through the `define-typgraphy-config`/`define-legacy-typography-config`.
|
|
@@ -1,7 +1,96 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use 'sass:math';
|
|
2
3
|
@use 'sass:meta';
|
|
3
|
-
@use '
|
|
4
|
-
@use '
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
@use './variables';
|
|
6
|
+
|
|
7
|
+
$_umbra-opacity: 0.2;
|
|
8
|
+
$_penumbra-opacity: 0.14;
|
|
9
|
+
$_ambient-opacity: 0.12;
|
|
10
|
+
|
|
11
|
+
$_umbra-map: (
|
|
12
|
+
0: '0px 0px 0px 0px',
|
|
13
|
+
1: '0px 2px 1px -1px',
|
|
14
|
+
2: '0px 3px 1px -2px',
|
|
15
|
+
3: '0px 3px 3px -2px',
|
|
16
|
+
4: '0px 2px 4px -1px',
|
|
17
|
+
5: '0px 3px 5px -1px',
|
|
18
|
+
6: '0px 3px 5px -1px',
|
|
19
|
+
7: '0px 4px 5px -2px',
|
|
20
|
+
8: '0px 5px 5px -3px',
|
|
21
|
+
9: '0px 5px 6px -3px',
|
|
22
|
+
10: '0px 6px 6px -3px',
|
|
23
|
+
11: '0px 6px 7px -4px',
|
|
24
|
+
12: '0px 7px 8px -4px',
|
|
25
|
+
13: '0px 7px 8px -4px',
|
|
26
|
+
14: '0px 7px 9px -4px',
|
|
27
|
+
15: '0px 8px 9px -5px',
|
|
28
|
+
16: '0px 8px 10px -5px',
|
|
29
|
+
17: '0px 8px 11px -5px',
|
|
30
|
+
18: '0px 9px 11px -5px',
|
|
31
|
+
19: '0px 9px 12px -6px',
|
|
32
|
+
20: '0px 10px 13px -6px',
|
|
33
|
+
21: '0px 10px 13px -6px',
|
|
34
|
+
22: '0px 10px 14px -6px',
|
|
35
|
+
23: '0px 11px 14px -7px',
|
|
36
|
+
24: '0px 11px 15px -7px',
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
$_penumbra-map: (
|
|
40
|
+
0: '0px 0px 0px 0px',
|
|
41
|
+
1: '0px 1px 1px 0px',
|
|
42
|
+
2: '0px 2px 2px 0px',
|
|
43
|
+
3: '0px 3px 4px 0px',
|
|
44
|
+
4: '0px 4px 5px 0px',
|
|
45
|
+
5: '0px 5px 8px 0px',
|
|
46
|
+
6: '0px 6px 10px 0px',
|
|
47
|
+
7: '0px 7px 10px 1px',
|
|
48
|
+
8: '0px 8px 10px 1px',
|
|
49
|
+
9: '0px 9px 12px 1px',
|
|
50
|
+
10: '0px 10px 14px 1px',
|
|
51
|
+
11: '0px 11px 15px 1px',
|
|
52
|
+
12: '0px 12px 17px 2px',
|
|
53
|
+
13: '0px 13px 19px 2px',
|
|
54
|
+
14: '0px 14px 21px 2px',
|
|
55
|
+
15: '0px 15px 22px 2px',
|
|
56
|
+
16: '0px 16px 24px 2px',
|
|
57
|
+
17: '0px 17px 26px 2px',
|
|
58
|
+
18: '0px 18px 28px 2px',
|
|
59
|
+
19: '0px 19px 29px 2px',
|
|
60
|
+
20: '0px 20px 31px 3px',
|
|
61
|
+
21: '0px 21px 33px 3px',
|
|
62
|
+
22: '0px 22px 35px 3px',
|
|
63
|
+
23: '0px 23px 36px 3px',
|
|
64
|
+
24: '0px 24px 38px 3px',
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
$_ambient-map: (
|
|
68
|
+
0: '0px 0px 0px 0px',
|
|
69
|
+
1: '0px 1px 3px 0px',
|
|
70
|
+
2: '0px 1px 5px 0px',
|
|
71
|
+
3: '0px 1px 8px 0px',
|
|
72
|
+
4: '0px 1px 10px 0px',
|
|
73
|
+
5: '0px 1px 14px 0px',
|
|
74
|
+
6: '0px 1px 18px 0px',
|
|
75
|
+
7: '0px 2px 16px 1px',
|
|
76
|
+
8: '0px 3px 14px 2px',
|
|
77
|
+
9: '0px 3px 16px 2px',
|
|
78
|
+
10: '0px 4px 18px 3px',
|
|
79
|
+
11: '0px 4px 20px 3px',
|
|
80
|
+
12: '0px 5px 22px 4px',
|
|
81
|
+
13: '0px 5px 24px 4px',
|
|
82
|
+
14: '0px 5px 26px 4px',
|
|
83
|
+
15: '0px 6px 28px 5px',
|
|
84
|
+
16: '0px 6px 30px 5px',
|
|
85
|
+
17: '0px 6px 32px 5px',
|
|
86
|
+
18: '0px 7px 34px 6px',
|
|
87
|
+
19: '0px 7px 36px 6px',
|
|
88
|
+
20: '0px 8px 38px 7px',
|
|
89
|
+
21: '0px 8px 40px 7px',
|
|
90
|
+
22: '0px 8px 42px 7px',
|
|
91
|
+
23: '0px 9px 44px 8px',
|
|
92
|
+
24: '0px 9px 46px 8px',
|
|
93
|
+
);
|
|
5
94
|
|
|
6
95
|
// A collection of mixins and CSS classes that can be used to apply elevation to a material
|
|
7
96
|
// element.
|
|
@@ -37,29 +126,7 @@ $prefix: 'mat-elevation-z';
|
|
|
37
126
|
// Applies the correct css rules to an element to give it the elevation specified by $zValue.
|
|
38
127
|
// The $zValue must be between 0 and 24.
|
|
39
128
|
@mixin elevation($zValue, $color: $color, $opacity: null) {
|
|
40
|
-
|
|
41
|
-
@include mdc-elevation.elevation($zValue, $color);
|
|
42
|
-
}
|
|
43
|
-
@else {
|
|
44
|
-
// Copied from @material/elevation/_elevation-theme.scss#_box-shadow
|
|
45
|
-
// TODO(mmalerba): Add support for graceful handling of CSS var color to MDC.
|
|
46
|
-
$umbra-z-value: map.get(mdc-elevation.$umbra-map, $zValue);
|
|
47
|
-
$penumbra-z-value: map.get(mdc-elevation.$penumbra-map, $zValue);
|
|
48
|
-
$ambient-z-value: map.get(mdc-elevation.$ambient-map, $zValue);
|
|
49
|
-
|
|
50
|
-
$color-opacity: if($opacity != null, $opacity, 1);
|
|
51
|
-
$umbra-color: _compute-color-opacity($color, mdc-elevation.$umbra-opacity * $color-opacity);
|
|
52
|
-
$penumbra-color:
|
|
53
|
-
_compute-color-opacity($color, mdc-elevation.$penumbra-opacity * $color-opacity);
|
|
54
|
-
$ambient-color: _compute-color-opacity($color, mdc-elevation.$ambient-opacity * $color-opacity);
|
|
55
|
-
|
|
56
|
-
$box-shadow: (
|
|
57
|
-
#{'#{$umbra-z-value} #{$umbra-color}'},
|
|
58
|
-
#{'#{$penumbra-z-value} #{$penumbra-color}'},
|
|
59
|
-
#{$ambient-z-value} $ambient-color
|
|
60
|
-
);
|
|
61
|
-
@include mdc-elevation.shadow($box-shadow);
|
|
62
|
-
}
|
|
129
|
+
box-shadow: get-box-shadow($zValue, $color, $opacity);
|
|
63
130
|
}
|
|
64
131
|
|
|
65
132
|
// Applies the elevation to an element in a manner that allows
|
|
@@ -71,8 +138,30 @@ $prefix: 'mat-elevation-z';
|
|
|
71
138
|
}
|
|
72
139
|
|
|
73
140
|
// Gets the box shadow value for a specific elevation.
|
|
74
|
-
@function get-box-shadow($
|
|
75
|
-
@
|
|
141
|
+
@function get-box-shadow($zValue, $shadow-color: black, $opacity: null) {
|
|
142
|
+
@if $zValue == null {
|
|
143
|
+
@return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@if meta.type-of($zValue) != number or not math.is-unitless($zValue) {
|
|
147
|
+
@error '$zValue must be a unitless number, but received `#{$zValue}`';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@if $zValue < 0 or $zValue > 24 {
|
|
151
|
+
@error '$zValue must be between 0 and 24, but received `#{$zValue}`';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
$umbra-z-value: map.get($_umbra-map, $zValue);
|
|
155
|
+
$penumbra-z-value: map.get($_penumbra-map, $zValue);
|
|
156
|
+
$ambient-z-value: map.get($_ambient-map, $zValue);
|
|
157
|
+
|
|
158
|
+
$color-opacity: if($opacity != null, $opacity, 1);
|
|
159
|
+
$umbra-color: _compute-color-opacity($shadow-color, $_umbra-opacity * $color-opacity);
|
|
160
|
+
$penumbra-color: _compute-color-opacity($shadow-color, $_penumbra-opacity * $color-opacity);
|
|
161
|
+
$ambient-color: _compute-color-opacity($shadow-color, $_ambient-opacity * $color-opacity);
|
|
162
|
+
|
|
163
|
+
@return string.unquote('#{$umbra-z-value} #{$umbra-color}, #{$penumbra-z-value} ' +
|
|
164
|
+
'#{$penumbra-color}, #{$ambient-z-value} #{$ambient-color}');
|
|
76
165
|
}
|
|
77
166
|
|
|
78
167
|
// Returns a string that can be used as the value for a transition property for elevation.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use '@material/tokens/v0_161' as mdc-tokens;
|
|
3
2
|
@use '../style/sass-utils';
|
|
4
3
|
@use '../m2' as m2-theming;
|
|
5
4
|
@use './m3';
|
|
5
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
6
6
|
@use '../tokens/m2' as m2-tokens;
|
|
7
7
|
@use './density';
|
|
8
8
|
@use './format-tokens';
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/// Creates a set of `md-ref-palette` tokens from the given palettes. (See
|
|
24
|
-
///
|
|
24
|
+
/// ./m3/definitions/_md-ref-palette.scss)
|
|
25
25
|
/// @param {Map} $primary The primary palette
|
|
26
26
|
/// @param {Map} $secondary The secondary palette
|
|
27
27
|
/// @param {Map} $tertiary The tertiary palette
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/// Creates a set of `md-ref-typeface` tokens from the given palettes. (See
|
|
43
|
-
///
|
|
43
|
+
/// ./m3/definitions/_md-ref-typeface.scss)
|
|
44
44
|
/// @param {List|String} $brand The font-family to use for brand text
|
|
45
45
|
/// @param {List|String} $plain The font-family to use for plain text
|
|
46
46
|
/// @param {String} $bold The font-weight to use for bold text
|
|
@@ -145,8 +145,8 @@ $_cached-token-slots: null;
|
|
|
145
145
|
);
|
|
146
146
|
|
|
147
147
|
$sys-colors: if($type == dark,
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
m3-token-definitions.md-sys-color-values-dark($ref),
|
|
149
|
+
m3-token-definitions.md-sys-color-values-light($ref));
|
|
150
150
|
|
|
151
151
|
@each $name, $value in $sys-colors {
|
|
152
152
|
--#{$system-variables-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
@@ -165,7 +165,7 @@ $_cached-token-slots: null;
|
|
|
165
165
|
md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
|
166
166
|
);
|
|
167
167
|
|
|
168
|
-
$sys-typescale:
|
|
168
|
+
$sys-typescale: m3-token-definitions.md-sys-typescale-values($ref);
|
|
169
169
|
|
|
170
170
|
@each $name, $value in $sys-typescale {
|
|
171
171
|
--#{$system-variables-prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
@@ -182,8 +182,8 @@ $_cached-token-slots: null;
|
|
|
182
182
|
|
|
183
183
|
@function _get-sys-color($type, $ref, $prefix) {
|
|
184
184
|
$mdc-sys-color: if($type == dark,
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
m3-token-definitions.md-sys-color-values-dark($ref),
|
|
186
|
+
m3-token-definitions.md-sys-color-values-light($ref));
|
|
187
187
|
|
|
188
188
|
@if (sass-utils.$use-system-color-variables) {
|
|
189
189
|
$keys: (
|
|
@@ -343,7 +343,7 @@ $_cached-token-slots: null;
|
|
|
343
343
|
|
|
344
344
|
@return create-map($keys, $prefix);
|
|
345
345
|
}
|
|
346
|
-
@return
|
|
346
|
+
@return m3-token-definitions.md-sys-typescale-values($ref);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/// Generates a set of namespaced color tokens for all components.
|
|
@@ -364,12 +364,12 @@ $_cached-token-slots: null;
|
|
|
364
364
|
md-sys-color: $sys-color,
|
|
365
365
|
// Because the elevation values are always combined with color values to create the box shadow,
|
|
366
366
|
// elevation needs to be part of the color dimension.
|
|
367
|
-
md-sys-elevation:
|
|
367
|
+
md-sys-elevation: m3-token-definitions.md-sys-elevation-values(),
|
|
368
368
|
// Because the state values are sometimes combined with color values to create rgba colors,
|
|
369
369
|
// state needs to be part of color dimension.
|
|
370
370
|
// TODO(mmalerba): If at some point we remove the need for these combined values, we can move
|
|
371
371
|
// state to the base dimension.
|
|
372
|
-
md-sys-state:
|
|
372
|
+
md-sys-state: m3-token-definitions.md-sys-state-values(),
|
|
373
373
|
)));
|
|
374
374
|
}
|
|
375
375
|
|
|
@@ -405,7 +405,7 @@ $system-variables-prefix) {
|
|
|
405
405
|
@function generate-base-tokens() {
|
|
406
406
|
// TODO(mmalerba): Exclude density tokens once implemented.
|
|
407
407
|
@return _generate-tokens((
|
|
408
|
-
md-sys-motion:
|
|
409
|
-
md-sys-shape:
|
|
408
|
+
md-sys-motion: m3-token-definitions.md-sys-motion-values(),
|
|
409
|
+
md-sys-shape: m3-token-definitions.md-sys-shape-values(),
|
|
410
410
|
), $include-non-systemized: true);
|
|
411
411
|
}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'sass:meta';
|
|
4
4
|
@use 'sass:string';
|
|
5
|
-
@use '
|
|
5
|
+
@use 'sass:color';
|
|
6
|
+
@use 'sass:math';
|
|
6
7
|
@use '../style/elevation';
|
|
7
8
|
@use '../style/sass-utils';
|
|
8
9
|
@use '../m2/palette' as m2-palette;
|
|
9
10
|
@use '../m2/theming' as m2-theming;
|
|
10
11
|
@use '../m2/typography' as m2-typography;
|
|
12
|
+
@use './m3/definitions' as m3-token-definitions;
|
|
11
13
|
|
|
12
14
|
// Indicates whether we're building internally. Used for backwards compatibility.
|
|
13
15
|
$private-is-internal-build: false;
|
|
@@ -160,7 +162,8 @@ $_component-prefix: null;
|
|
|
160
162
|
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
|
|
161
163
|
/// @return {List} Map of token names to values
|
|
162
164
|
@function get-mdc-tokens($component, $systems, $exclude-hardcoded) {
|
|
163
|
-
$
|
|
165
|
+
$full-name: 'md-comp-' + $component + '-values';
|
|
166
|
+
$fn: meta.get-function($name: $full-name, $module: 'm3-token-definitions');
|
|
164
167
|
@return meta.call($fn, $systems, $exclude-hardcoded);
|
|
165
168
|
}
|
|
166
169
|
|
|
@@ -367,6 +370,66 @@ $_component-prefix: null;
|
|
|
367
370
|
@return $result;
|
|
368
371
|
}
|
|
369
372
|
|
|
373
|
+
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
|
|
374
|
+
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
|
|
375
|
+
/// backwards compatibility.
|
|
376
|
+
/// @param {Color} $value Color for which we're calculating the contrast tone.
|
|
377
|
+
/// @param {Boolean} $is-dark Whether the current theme is dark.
|
|
378
|
+
/// @return {Map} Either `dark` or `light`.
|
|
379
|
+
@function contrast-tone($value, $is-dark) {
|
|
380
|
+
@if ($value == 'dark') {
|
|
381
|
+
@return 'light';
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
@if ($value == 'light') {
|
|
385
|
+
@return 'dark';
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Fallback if the app is using a non-color palette (e.g. CSS variable based).
|
|
389
|
+
@if (meta.type-of($value) != 'color') {
|
|
390
|
+
@return if($is-dark, 'light', 'dark');
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
$minimum-contrast: 3.1;
|
|
394
|
+
$light-contrast: _contrast($value, #fff);
|
|
395
|
+
$dark-contrast: _contrast($value, rgba(0, 0, 0, 0.87));
|
|
396
|
+
|
|
397
|
+
@if ($light-contrast < $minimum-contrast) and ($dark-contrast > $light-contrast) {
|
|
398
|
+
@return 'dark';
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
@return 'light';
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
@function _linear-channel-value($channel-value) {
|
|
405
|
+
$normalized-channel-value: math.div($channel-value, 255);
|
|
406
|
+
|
|
407
|
+
@if ($normalized-channel-value < 0.03928) {
|
|
408
|
+
@return math.div($normalized-channel-value, 12.92);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
@return math.pow(math.div($normalized-channel-value + 0.055, 1.055), 2.4);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Calculate the luminance for a color.
|
|
415
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
416
|
+
@function _luminance($color) {
|
|
417
|
+
$red: _linear-channel-value(color.red($color));
|
|
418
|
+
$green: _linear-channel-value(color.green($color));
|
|
419
|
+
$blue: _linear-channel-value(color.blue($color));
|
|
420
|
+
|
|
421
|
+
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Calculate the contrast ratio between two colors.
|
|
425
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
426
|
+
@function _contrast($back, $front) {
|
|
427
|
+
$back-lum: _luminance($back) + 0.05;
|
|
428
|
+
$fore-lum: _luminance($front) + 0.05;
|
|
429
|
+
|
|
430
|
+
@return math.div(math.max($back-lum, $fore-lum), math.min($back-lum, $fore-lum));
|
|
431
|
+
}
|
|
432
|
+
|
|
370
433
|
/// Verifies that the token overrides exist and are used in one of the given token maps.
|
|
371
434
|
@mixin _validate-token-overrides($overrides: (), $token-maps) {
|
|
372
435
|
$valid-token-names: ();
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../../../theming/theming';
|
|
4
4
|
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mat, fab-small);
|
|
@@ -63,7 +62,7 @@ $prefix: (mat, fab-small);
|
|
|
63
62
|
@if (token-utils.$private-is-internal-build or meta.type-of($contrast-color) != 'color') {
|
|
64
63
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
65
64
|
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
66
|
-
$contrast-tone:
|
|
65
|
+
$contrast-tone: token-utils.contrast-tone($container-color, $is-dark);
|
|
67
66
|
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
68
67
|
$foreground-color: $color;
|
|
69
68
|
$state-layer-color: $color;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../../../theming/theming';
|
|
4
4
|
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mat, fab);
|
|
@@ -63,7 +62,7 @@ $prefix: (mat, fab);
|
|
|
63
62
|
@if (token-utils.$private-is-internal-build or meta.type-of($contrast-color) != 'color') {
|
|
64
63
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
65
64
|
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
66
|
-
$contrast-tone:
|
|
65
|
+
$contrast-tone: token-utils.contrast-tone($container-color, $is-dark);
|
|
67
66
|
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
68
67
|
$foreground-color: $color;
|
|
69
68
|
$state-layer-color: $color;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../../../theming/theming';
|
|
4
4
|
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mat, filled-button);
|
|
@@ -60,7 +59,7 @@ $prefix: (mat, filled-button);
|
|
|
60
59
|
@if (token-utils.$private-is-internal-build or meta.type-of($contrast-color) != 'color') {
|
|
61
60
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
62
61
|
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
63
|
-
$contrast-tone:
|
|
62
|
+
$contrast-tone: token-utils.contrast-tone($container-color, $is-dark);
|
|
64
63
|
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
65
64
|
$state-layer-color: $color;
|
|
66
65
|
$ripple-color: rgba($color, 0.1);
|
|
@@ -52,8 +52,6 @@ $prefix: (mat, form-field);
|
|
|
52
52
|
error-hover-trailing-icon-color: unset,
|
|
53
53
|
error-trailing-icon-color: unset,
|
|
54
54
|
|
|
55
|
-
// These values are taken from the MDC select implementation:
|
|
56
|
-
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-select/_select-theme.scss
|
|
57
55
|
enabled-select-arrow-color: inspection.get-theme-color($theme, foreground, icon, 0.54),
|
|
58
56
|
disabled-select-arrow-color: inspection.get-theme-color($theme, foreground, icon, 0.38),
|
|
59
57
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../../../theming/theming';
|
|
4
4
|
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../style/sass-utils';
|
|
6
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mat, protected-button);
|
|
@@ -60,7 +59,7 @@ $prefix: (mat, protected-button);
|
|
|
60
59
|
@if (token-utils.$private-is-internal-build or meta.type-of($contrast-color) != 'color') {
|
|
61
60
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
62
61
|
$container-color: inspection.get-theme-color($theme, $palette-name);
|
|
63
|
-
$contrast-tone:
|
|
62
|
+
$contrast-tone: token-utils.contrast-tone($container-color, $is-dark);
|
|
64
63
|
$color: if($contrast-tone == 'dark', #000, #fff);
|
|
65
64
|
$state-layer-color: $color;
|
|
66
65
|
$ripple-color: rgba($color, 0.1);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@use '../../../theming/theming';
|
|
5
5
|
@use '../../../theming/inspection';
|
|
6
6
|
@use '../../../style/sass-utils';
|
|
7
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
8
7
|
@use '../../token-utils';
|
|
9
8
|
|
|
10
9
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
@@ -61,7 +60,7 @@ $prefix: (mdc, checkbox);
|
|
|
61
60
|
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
|
|
62
61
|
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
|
|
63
62
|
@if (token-utils.$private-is-internal-build) {
|
|
64
|
-
$contrast-tone:
|
|
63
|
+
$contrast-tone: token-utils.contrast-tone($palette-selected, $is-dark);
|
|
65
64
|
$selected-checkmark-color: if($contrast-tone == 'dark', #000, #fff);
|
|
66
65
|
}
|
|
67
66
|
@else {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use '../../../style/sass-utils';
|
|
4
4
|
@use '../../../theming/inspection';
|
|
5
5
|
@use '../../../theming/theming';
|
|
6
|
-
@use '../../../mdc-helpers/mdc-helpers';
|
|
7
6
|
|
|
8
7
|
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
9
8
|
$prefix: (mdc, filled-button);
|
|
@@ -71,7 +70,7 @@ $prefix: (mdc, filled-button);
|
|
|
71
70
|
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
|
|
72
71
|
@if (token-utils.$private-is-internal-build) {
|
|
73
72
|
$is-dark: inspection.get-theme-type($theme) == dark;
|
|
74
|
-
$contrast-tone:
|
|
73
|
+
$contrast-tone: token-utils.contrast-tone($container-color, $is-dark);
|
|
75
74
|
$label-text-color: if($contrast-tone == 'dark', #000, #fff);
|
|
76
75
|
}
|
|
77
76
|
@else {
|