@expressivecss/expressive 0.3.0 → 0.5.0
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/CHANGELOG.md +96 -0
- package/README.md +4 -9
- package/dist/css/expressive.css +3183 -2150
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/js/expressive.cjs +1254 -1567
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +1254 -1567
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +12 -22
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +1254 -1568
- package/dist/js/expressive.mjs.map +4 -4
- package/dist/types/behaviors/bottomSheets.d.ts +18 -0
- package/dist/types/behaviors/sideSheets.d.ts +18 -0
- package/dist/types/components/autocomplete.d.ts +13 -20
- package/dist/types/components/buttons.d.ts +2 -2
- package/dist/types/components/cards.d.ts +3 -6
- package/dist/types/components/carousel.d.ts +3 -3
- package/dist/types/components/characterCounter.d.ts +3 -5
- package/dist/types/components/chips.d.ts +2 -2
- package/dist/types/components/datepicker.d.ts +2 -8
- package/dist/types/components/index.d.ts +3 -6
- package/dist/types/components/lightbox.d.ts +2 -2
- package/dist/types/components/{dropdown.d.ts → menu.d.ts} +48 -38
- package/dist/types/components/navigationRail.d.ts +53 -0
- package/dist/types/components/parallax.d.ts +2 -8
- package/dist/types/components/range.d.ts +5 -2
- package/dist/types/components/registry.d.ts +7 -19
- package/dist/types/components/scrollspy.d.ts +26 -50
- package/dist/types/components/select.d.ts +28 -14
- package/dist/types/components/sidenav.d.ts +40 -55
- package/dist/types/components/slider.d.ts +2 -2
- package/dist/types/components/{toasts.d.ts → snackbar.d.ts} +28 -25
- package/dist/types/components/tabs.d.ts +2 -2
- package/dist/types/components/timepicker.d.ts +2 -4
- package/dist/types/components/tooltip.d.ts +2 -2
- package/dist/types/core/component.d.ts +4 -4
- package/dist/types/index.d.ts +3 -1
- package/package.json +4 -3
- package/src/sass/README.md +13 -15
- package/src/sass/abstracts/_breakpoints.scss +14 -19
- package/src/sass/abstracts/_mixins.scss +3 -3
- package/src/sass/abstracts/_variables.scss +27 -23
- package/src/sass/base/_global.scss +1 -1
- package/src/sass/base/_grid.scss +64 -133
- package/src/sass/base/_index.scss +1 -1
- package/src/sass/components/_badges.scss +76 -61
- package/src/sass/components/_bottom-sheet.scss +137 -0
- package/src/sass/components/_buttons.scss +22 -54
- package/src/sass/components/_cards.scss +54 -127
- package/src/sass/components/_carousel.scss +4 -6
- package/src/sass/components/_chips.scss +6 -5
- package/src/sass/components/_datepicker.scss +1 -15
- package/src/sass/components/_dialog.scss +268 -0
- package/src/sass/components/_index.scss +9 -7
- package/src/sass/components/_list.scss +253 -0
- package/src/sass/components/_menu.scss +341 -0
- package/src/sass/components/_navbar.scss +68 -117
- package/src/sass/components/_navigation-bar.scss +165 -0
- package/src/sass/components/_navigation-rail.scss +308 -0
- package/src/sass/components/_page-footer.scss +138 -15
- package/src/sass/components/_parallax.scss +7 -28
- package/src/sass/components/_preloader.scss +145 -300
- package/src/sass/components/_scrollspy.scss +18 -0
- package/src/sass/components/_side-sheet.scss +193 -0
- package/src/sass/components/_sidenav.scss +281 -146
- package/src/sass/components/{_toast.scss → _snackbar.scss} +43 -43
- package/src/sass/components/_table_of_contents.scss +30 -14
- package/src/sass/components/_tabs.scss +43 -50
- package/src/sass/components/_toolbar.scss +93 -27
- package/src/sass/components/_tooltip.scss +5 -10
- package/src/sass/components/_transitions.scss +0 -5
- package/src/sass/components/forms/_fieldset.scss +1 -1
- package/src/sass/components/forms/_index.scss +0 -5
- package/src/sass/components/forms/_input-fields.scss +52 -55
- package/src/sass/components/forms/_range.scss +423 -98
- package/src/sass/components/forms/_select.scss +177 -60
- package/src/sass/components/forms/_switches.scss +21 -8
- package/src/sass/tokens/_reference.scss +37 -13
- package/src/sass/tokens/_theme.scss +5 -13
- package/src/sass/utilities/_colors.scss +16 -74
- package/src/sass/utilities/_helpers.scss +1 -3
- package/src/sass/utilities/_typescale.scss +0 -5
- package/src/sass/utilities/_visibility.scss +10 -2
- package/dist/types/components/collapsible.d.ts +0 -96
- package/dist/types/components/modal.d.ts +0 -45
- package/dist/types/components/pushpin.d.ts +0 -51
- package/dist/types/components/tapTarget.d.ts +0 -57
- package/src/sass/components/_collapsible.scss +0 -181
- package/src/sass/components/_collection.scss +0 -198
- package/src/sass/components/_dropdown.scss +0 -129
- package/src/sass/components/_modal.scss +0 -208
- package/src/sass/components/_pushpin.scss +0 -11
- package/src/sass/components/_tapTarget.scss +0 -191
|
@@ -1,103 +1,220 @@
|
|
|
1
1
|
@use "../../abstracts" as *;
|
|
2
2
|
|
|
3
|
+
// Select (exposed menu).
|
|
4
|
+
//
|
|
5
|
+
// Anatomy is the HTML. A <select> is the control. FormSelect wraps it
|
|
6
|
+
// in .field (or reuses an existing one) and paints a text field + menu.
|
|
7
|
+
// .browser-default keeps the native control. .caret is the trailing
|
|
8
|
+
// expand icon (CSS, not an SVG node).
|
|
9
|
+
//
|
|
10
|
+
// Tokens follow https://m3.material.io/components/menus/overview
|
|
11
|
+
// (exposed menu = text field + menu) and the filled/outlined field
|
|
12
|
+
// tokens in _input-fields.scss.
|
|
13
|
+
// field 56dp, same chrome as .field
|
|
14
|
+
// trailing icon 24dp, 12dp from the end, rotates when open
|
|
15
|
+
// selected item tertiary-container + trailing check
|
|
16
|
+
// optgroup on-surface-variant, outline-variant rule
|
|
17
|
+
//
|
|
18
|
+
$_select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
|
|
19
|
+
$_select-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
|
|
20
|
+
|
|
21
|
+
// Native / no-js / .browser-default: a 56dp field, not a 3rem box.
|
|
22
|
+
select {
|
|
23
|
+
--md-comp-filled-select-container-color: var(--md-sys-color-surface-container-highest);
|
|
24
|
+
--md-comp-filled-select-container-shape: 1rem;
|
|
25
|
+
--md-comp-filled-select-input-text-color: var(--md-sys-color-on-surface);
|
|
26
|
+
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 56px;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 16px 12px;
|
|
32
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
33
|
+
border-radius: var(--md-comp-filled-select-container-shape);
|
|
34
|
+
background-color: var(--md-comp-filled-select-container-color);
|
|
35
|
+
color: var(--md-comp-filled-select-input-text-color);
|
|
36
|
+
@include typescale("body-large");
|
|
37
|
+
font-family: $font-stack;
|
|
38
|
+
|
|
39
|
+
&:focus {
|
|
40
|
+
outline: 2px solid var(--md-sys-color-primary);
|
|
41
|
+
outline-offset: 2px;
|
|
42
|
+
border-color: var(--md-sys-color-primary);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:disabled {
|
|
46
|
+
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
47
|
+
border-color: color-mix(in oklab, var(--md-sys-color-on-surface) 12%, transparent);
|
|
48
|
+
background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 4%, transparent);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
3
52
|
select.browser-default {
|
|
4
53
|
opacity: 1;
|
|
5
|
-
color: var(--md-sys-color-on-background);
|
|
6
54
|
}
|
|
7
55
|
|
|
8
|
-
|
|
9
|
-
|
|
56
|
+
@supports (appearance: base-select) {
|
|
57
|
+
select.browser-default,
|
|
58
|
+
select.browser-default::picker(select) {
|
|
59
|
+
appearance: base-select;
|
|
60
|
+
}
|
|
10
61
|
|
|
11
|
-
select {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
62
|
+
select.browser-default::picker(select) {
|
|
63
|
+
border: none;
|
|
64
|
+
border-radius: var(--md-comp-menu-container-shape, 1rem);
|
|
65
|
+
background-color: var(--md-sys-color-surface);
|
|
66
|
+
color: var(--md-sys-color-on-surface);
|
|
67
|
+
@include z-depth("2");
|
|
68
|
+
}
|
|
18
69
|
}
|
|
19
70
|
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
71
|
+
.field:has(> .hide-select) {
|
|
72
|
+
// Match the vertical menu's 16dp surface so the closed field and the
|
|
73
|
+
// open list read as one shape.
|
|
74
|
+
--md-comp-filled-select-container-shape: 1rem;
|
|
75
|
+
--md-comp-menu-container-shape: 1rem;
|
|
76
|
+
--md-comp-filled-select-trailing-icon-size: 24px;
|
|
77
|
+
--md-comp-filled-select-trailing-icon-color: var(--md-sys-color-on-surface-variant);
|
|
78
|
+
--md-comp-menu-item-leading-image-size: 40px;
|
|
24
79
|
|
|
25
|
-
.select-wrapper {
|
|
26
80
|
position: relative;
|
|
81
|
+
border-radius: var(--md-comp-filled-select-container-shape);
|
|
27
82
|
|
|
83
|
+
> input.menu-trigger {
|
|
84
|
+
border-radius: inherit;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
> input.menu-trigger {
|
|
88
|
+
padding-inline-end: 52px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Trailing expand icon. Empty .caret is the hook; the glyph is a mask.
|
|
92
|
+
// `left: auto` beats `.field > span { left: 16px }` if that rule ever
|
|
93
|
+
// matches again — left + width would otherwise ignore inset-inline-end
|
|
94
|
+
// and pin the chevron over the value.
|
|
28
95
|
.caret {
|
|
29
96
|
position: absolute;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
z-index:
|
|
35
|
-
|
|
97
|
+
inset-block-start: 16px;
|
|
98
|
+
inset-inline-start: auto;
|
|
99
|
+
left: auto;
|
|
100
|
+
inset-inline-end: 12px;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
width: var(--md-comp-filled-select-trailing-icon-size);
|
|
103
|
+
height: var(--md-comp-filled-select-trailing-icon-size);
|
|
104
|
+
margin: 0;
|
|
36
105
|
pointer-events: none;
|
|
106
|
+
background-color: var(--md-comp-filled-select-trailing-icon-color);
|
|
107
|
+
mask: $_select-chevron center / 24px no-repeat;
|
|
108
|
+
transition: transform 0.2s ease;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:has(> input[aria-expanded="true"]) .caret,
|
|
112
|
+
&:has(> menu:popover-open) .caret {
|
|
113
|
+
transform: rotate(180deg);
|
|
37
114
|
}
|
|
38
115
|
|
|
39
|
-
//
|
|
40
|
-
//
|
|
116
|
+
// Keep the native select in the field's box so constraint-validation
|
|
117
|
+
// bubbles land on the control, not at (0, 0).
|
|
41
118
|
.hide-select {
|
|
42
|
-
width: 0;
|
|
43
|
-
height: 0;
|
|
44
|
-
overflow: hidden;
|
|
45
119
|
position: absolute;
|
|
46
|
-
|
|
120
|
+
inset: 0;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
opacity: 0;
|
|
123
|
+
pointer-events: none;
|
|
47
124
|
z-index: -1;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
125
|
|
|
51
|
-
select
|
|
52
|
-
|
|
126
|
+
select {
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
margin: 0;
|
|
130
|
+
padding: 0;
|
|
131
|
+
border: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
53
134
|
}
|
|
54
135
|
|
|
55
|
-
.select
|
|
56
|
-
+ label {
|
|
57
|
-
color: var(--md-sys-color-on-surface);
|
|
58
|
-
}
|
|
136
|
+
.field:has(> .hide-select).disabled {
|
|
59
137
|
.caret {
|
|
60
|
-
|
|
138
|
+
background-color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
+ label,
|
|
142
|
+
> label {
|
|
143
|
+
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
61
144
|
}
|
|
62
145
|
}
|
|
63
146
|
|
|
64
|
-
.select
|
|
65
|
-
color: var(--md-sys-color-on-surface);
|
|
147
|
+
.field:has(> .hide-select) > input.menu-trigger:disabled {
|
|
66
148
|
cursor: default;
|
|
67
149
|
user-select: none;
|
|
68
150
|
}
|
|
69
151
|
|
|
70
|
-
|
|
71
|
-
|
|
152
|
+
menu[role="listbox"] > li.disabled,
|
|
153
|
+
menu[role="listbox"] > li.disabled > span,
|
|
154
|
+
menu[role="listbox"] > li.optgroup {
|
|
155
|
+
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
menu[role="listbox"] > li:not(.optgroup, .divider) {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
72
161
|
}
|
|
73
162
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
//background-color: transparent;
|
|
163
|
+
menu[role="listbox"] > li.selected:not(.disabled, .optgroup) {
|
|
164
|
+
background-color: var(--md-comp-menu-item-selected-container-color, var(--md-sys-color-tertiary-container));
|
|
165
|
+
color: var(--md-comp-menu-item-selected-label-text-color, var(--md-sys-color-on-tertiary-container));
|
|
166
|
+
border-radius: var(--md-comp-menu-item-selected-container-shape, 12px);
|
|
79
167
|
}
|
|
80
168
|
|
|
81
|
-
//
|
|
82
|
-
.select-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
169
|
+
// Single-select: trailing check. Multi-select already has a leading checkbox.
|
|
170
|
+
menu[role="listbox"]:not(.multiple-select-menu) > li.selected:not(.disabled, .optgroup)::after {
|
|
171
|
+
content: "";
|
|
172
|
+
flex: 0 0 20px;
|
|
173
|
+
width: 20px;
|
|
174
|
+
height: 20px;
|
|
175
|
+
margin-inline-start: auto;
|
|
176
|
+
margin-inline-end: 8px;
|
|
177
|
+
background-color: var(--md-comp-menu-item-selected-leading-icon-color, var(--md-sys-color-on-tertiary-container));
|
|
178
|
+
mask: $_select-check center / 20px no-repeat;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
menu[role="listbox"] li img {
|
|
182
|
+
box-sizing: border-box;
|
|
183
|
+
flex: 0 0 var(--md-comp-menu-item-leading-image-size);
|
|
184
|
+
width: var(--md-comp-menu-item-leading-image-size);
|
|
185
|
+
height: var(--md-comp-menu-item-leading-image-size);
|
|
186
|
+
margin: 4px 12px;
|
|
187
|
+
object-fit: cover;
|
|
188
|
+
border-radius: 4px;
|
|
189
|
+
order: 1;
|
|
190
|
+
margin-inline-start: auto;
|
|
191
|
+
|
|
192
|
+
&.left {
|
|
193
|
+
order: 0;
|
|
194
|
+
margin-inline-start: 12px;
|
|
195
|
+
margin-inline-end: 0;
|
|
88
196
|
}
|
|
89
197
|
}
|
|
90
198
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
199
|
+
menu[role="listbox"] li.optgroup {
|
|
200
|
+
cursor: default;
|
|
201
|
+
pointer-events: none;
|
|
202
|
+
|
|
203
|
+
&:not(:first-child) {
|
|
204
|
+
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
96
205
|
}
|
|
97
|
-
|
|
206
|
+
|
|
207
|
+
> span {
|
|
98
208
|
color: var(--md-sys-color-on-surface-variant);
|
|
99
209
|
}
|
|
100
|
-
|
|
101
|
-
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
menu[role="listbox"] li.optgroup-option {
|
|
213
|
+
padding-inline-start: 1rem;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@media (prefers-reduced-motion: reduce) {
|
|
217
|
+
.field:has(> .hide-select) .caret {
|
|
218
|
+
transition: none;
|
|
102
219
|
}
|
|
103
220
|
}
|
|
@@ -68,13 +68,21 @@
|
|
|
68
68
|
border: 2px solid var(--md-sys-color-outline);
|
|
69
69
|
border-radius: 16px;
|
|
70
70
|
background-color: var(--md-sys-color-surface-variant);
|
|
71
|
+
// Size the image to the handle. A 100% gradient keeps the circle in
|
|
72
|
+
// the middle of the track, so background-position cannot put off on
|
|
73
|
+
// the start and on on the end.
|
|
71
74
|
background-image: radial-gradient(
|
|
72
|
-
circle,
|
|
73
|
-
var(--md-sys-color-outline)
|
|
74
|
-
transparent
|
|
75
|
+
circle closest-side,
|
|
76
|
+
var(--md-sys-color-outline) 100%,
|
|
77
|
+
transparent 101%
|
|
75
78
|
);
|
|
76
79
|
background-repeat: no-repeat;
|
|
77
|
-
background-
|
|
80
|
+
background-origin: padding-box;
|
|
81
|
+
background-size: var(--md-comp-switch-handle-unselected) var(--md-comp-switch-handle-unselected);
|
|
82
|
+
// Lengths only. A % in background-position is “align this point of the
|
|
83
|
+
// image with that point of the box”, so calc(100% - handle) leaves the
|
|
84
|
+
// thumb on the start and it only grows.
|
|
85
|
+
background-position: 6px 50%;
|
|
78
86
|
cursor: pointer;
|
|
79
87
|
transition: background-color .2s ease, background-position .2s ease,
|
|
80
88
|
background-size .2s ease, border-color .2s ease, box-shadow .2s ease;
|
|
@@ -83,11 +91,16 @@
|
|
|
83
91
|
border-color: var(--md-sys-color-primary);
|
|
84
92
|
background-color: var(--md-sys-color-primary);
|
|
85
93
|
background-image: radial-gradient(
|
|
86
|
-
circle,
|
|
87
|
-
var(--md-sys-color-on-primary)
|
|
88
|
-
transparent
|
|
94
|
+
circle closest-side,
|
|
95
|
+
var(--md-sys-color-on-primary) 100%,
|
|
96
|
+
transparent 101%
|
|
89
97
|
);
|
|
90
|
-
background-
|
|
98
|
+
background-size: var(--md-comp-switch-handle-selected) var(--md-comp-switch-handle-selected);
|
|
99
|
+
// padding-box is track minus the 2px border on each side; 2px inset.
|
|
100
|
+
background-position: calc(
|
|
101
|
+
var(--md-comp-switch-track-width) - 4px - 2px - var(--md-comp-switch-handle-selected)
|
|
102
|
+
)
|
|
103
|
+
50%;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
106
|
&:hover {
|
|
@@ -42,9 +42,11 @@ $md-source: #006A79 !default;
|
|
|
42
42
|
|
|
43
43
|
// tone -> OKLCH lightness. Fitted against the reference ramps; see the test.
|
|
44
44
|
$tones: (
|
|
45
|
-
0: 0%,
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
0: 0%, 4: 8.95%, 6: 13.42%, 10: 22.37%, 12: 24.09%, 17: 28.40%,
|
|
46
|
+
20: 30.99%, 22: 32.70%, 24: 34.41%, 25: 35.26%, 30: 39.48%, 35: 43.79%,
|
|
47
|
+
40: 48.14%, 50: 56.83%, 60: 65.42%, 70: 74.04%, 80: 82.63%, 87: 88.72%,
|
|
48
|
+
90: 91.33%, 92: 93.05%, 94: 94.76%, 95: 95.62%, 96: 96.50%, 98: 98.25%,
|
|
49
|
+
99: 99.19%, 100: 100%
|
|
48
50
|
) !default;
|
|
49
51
|
|
|
50
52
|
// Per-ramp hue offset from the source hue, and target chroma. Chroma is a
|
|
@@ -72,37 +74,59 @@ $ramps: (
|
|
|
72
74
|
$sys-light: (
|
|
73
75
|
"primary": "primary40", "on-primary": "primary100",
|
|
74
76
|
"primary-container": "primary90", "on-primary-container": "primary10",
|
|
77
|
+
"primary-fixed": "primary90", "primary-fixed-dim": "primary80",
|
|
78
|
+
"on-primary-fixed": "primary10", "on-primary-fixed-variant": "primary30",
|
|
75
79
|
"secondary": "secondary40", "on-secondary": "secondary100",
|
|
76
80
|
"secondary-container": "secondary90", "on-secondary-container": "secondary10",
|
|
81
|
+
"secondary-fixed": "secondary90", "secondary-fixed-dim": "secondary80",
|
|
82
|
+
"on-secondary-fixed": "secondary10", "on-secondary-fixed-variant": "secondary30",
|
|
77
83
|
"tertiary": "tertiary40", "on-tertiary": "tertiary100",
|
|
78
84
|
"tertiary-container": "tertiary90", "on-tertiary-container": "tertiary10",
|
|
85
|
+
"tertiary-fixed": "tertiary90", "tertiary-fixed-dim": "tertiary80",
|
|
86
|
+
"on-tertiary-fixed": "tertiary10", "on-tertiary-fixed-variant": "tertiary30",
|
|
79
87
|
"error": "error40", "on-error": "error100",
|
|
80
88
|
"error-container": "error90", "on-error-container": "error10",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"surface-
|
|
89
|
+
"surface": "neutral98", "on-surface": "neutral10",
|
|
90
|
+
"on-surface-variant": "neutral-variant30",
|
|
91
|
+
"surface-dim": "neutral87", "surface-bright": "neutral98",
|
|
92
|
+
"surface-container-lowest": "neutral100", "surface-container-low": "neutral96",
|
|
93
|
+
"surface-container": "neutral94", "surface-container-high": "neutral92",
|
|
94
|
+
"surface-container-highest": "neutral90",
|
|
84
95
|
"outline": "neutral-variant50", "outline-variant": "neutral-variant80",
|
|
85
96
|
"inverse-surface": "neutral20", "inverse-on-surface": "neutral95",
|
|
86
|
-
"inverse-primary": "primary80",
|
|
87
|
-
"
|
|
97
|
+
"inverse-primary": "primary80",
|
|
98
|
+
"scrim": "neutral0", "shadow": "neutral0",
|
|
99
|
+
"background": "neutral98", "on-background": "neutral10",
|
|
100
|
+
"surface-variant": "neutral-variant90", "surface-tint": "primary40"
|
|
88
101
|
) !default;
|
|
89
102
|
|
|
90
103
|
$sys-dark: (
|
|
91
104
|
"primary": "primary80", "on-primary": "primary20",
|
|
92
105
|
"primary-container": "primary30", "on-primary-container": "primary90",
|
|
106
|
+
"primary-fixed": "primary90", "primary-fixed-dim": "primary80",
|
|
107
|
+
"on-primary-fixed": "primary10", "on-primary-fixed-variant": "primary30",
|
|
93
108
|
"secondary": "secondary80", "on-secondary": "secondary20",
|
|
94
109
|
"secondary-container": "secondary30", "on-secondary-container": "secondary90",
|
|
110
|
+
"secondary-fixed": "secondary90", "secondary-fixed-dim": "secondary80",
|
|
111
|
+
"on-secondary-fixed": "secondary10", "on-secondary-fixed-variant": "secondary30",
|
|
95
112
|
"tertiary": "tertiary80", "on-tertiary": "tertiary20",
|
|
96
113
|
"tertiary-container": "tertiary30", "on-tertiary-container": "tertiary90",
|
|
114
|
+
"tertiary-fixed": "tertiary90", "tertiary-fixed-dim": "tertiary80",
|
|
115
|
+
"on-tertiary-fixed": "tertiary10", "on-tertiary-fixed-variant": "tertiary30",
|
|
97
116
|
"error": "error80", "on-error": "error20",
|
|
98
117
|
"error-container": "error30", "on-error-container": "error90",
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"surface-
|
|
118
|
+
"surface": "neutral6", "on-surface": "neutral90",
|
|
119
|
+
"on-surface-variant": "neutral-variant80",
|
|
120
|
+
"surface-dim": "neutral6", "surface-bright": "neutral24",
|
|
121
|
+
"surface-container-lowest": "neutral4", "surface-container-low": "neutral10",
|
|
122
|
+
"surface-container": "neutral12", "surface-container-high": "neutral17",
|
|
123
|
+
"surface-container-highest": "neutral22",
|
|
102
124
|
"outline": "neutral-variant60", "outline-variant": "neutral-variant30",
|
|
103
125
|
"inverse-surface": "neutral90", "inverse-on-surface": "neutral10",
|
|
104
|
-
"inverse-primary": "primary40",
|
|
105
|
-
"
|
|
126
|
+
"inverse-primary": "primary40",
|
|
127
|
+
"scrim": "neutral0", "shadow": "neutral0",
|
|
128
|
+
"background": "neutral6", "on-background": "neutral90",
|
|
129
|
+
"surface-variant": "neutral-variant30", "surface-tint": "primary80"
|
|
106
130
|
) !default;
|
|
107
131
|
|
|
108
132
|
:root {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
1
3
|
// Maps the resolved pairs from tokens/_reference.scss onto the live
|
|
2
4
|
// --md-sys-color-* names that the rest of the framework consumes.
|
|
3
5
|
//
|
|
4
|
-
// This file used to spell out all
|
|
6
|
+
// This file used to spell out all tokens four times - once for the light
|
|
5
7
|
// default, once inside @media (prefers-color-scheme: dark), and once for each
|
|
6
8
|
// of :root[theme='light'] / [theme='dark'] - because a custom property can
|
|
7
9
|
// only hold one value per selector. light-dark() holds both, so the mapping is
|
|
@@ -18,18 +20,6 @@
|
|
|
18
20
|
// They are the documented way to re-theme the framework (see the docs' Themes
|
|
19
21
|
// page) and several components reference them directly.
|
|
20
22
|
|
|
21
|
-
$sys-color-roles: (
|
|
22
|
-
"primary", "on-primary", "primary-container", "on-primary-container",
|
|
23
|
-
"secondary", "on-secondary", "secondary-container", "on-secondary-container",
|
|
24
|
-
"tertiary", "on-tertiary", "tertiary-container", "on-tertiary-container",
|
|
25
|
-
"error", "on-error", "error-container", "on-error-container",
|
|
26
|
-
"outline", "outline-variant",
|
|
27
|
-
"background", "on-background",
|
|
28
|
-
"surface", "on-surface", "surface-variant", "on-surface-variant",
|
|
29
|
-
"inverse-surface", "inverse-on-surface", "inverse-primary",
|
|
30
|
-
"shadow", "surface-tint", "scrim"
|
|
31
|
-
) !default;
|
|
32
|
-
|
|
33
23
|
:root, :host {
|
|
34
24
|
// `light dark` means: follow the OS unless an ancestor says otherwise.
|
|
35
25
|
color-scheme: light dark;
|
|
@@ -45,5 +35,7 @@ $sys-color-roles: (
|
|
|
45
35
|
/* ===================================================================== Themes */
|
|
46
36
|
|
|
47
37
|
// Opting out of the OS preference. Every token above re-resolves from these.
|
|
38
|
+
// `auto` is the explicit follow-OS value — same as omitting the attribute.
|
|
48
39
|
:root[theme='light'] { color-scheme: light; }
|
|
49
40
|
:root[theme='dark'] { color-scheme: dark; }
|
|
41
|
+
:root[theme='auto'] { color-scheme: light dark; }
|
|
@@ -1,74 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.on-secondary-container-text { color: var(--md-sys-color-on-secondary-container); }
|
|
18
|
-
|
|
19
|
-
.tertiary { background-color: var(--md-sys-color-tertiary); }
|
|
20
|
-
.tertiary-text { color: var(--md-sys-color-tertiary); }
|
|
21
|
-
.on-tertiary { background-color: var(--md-sys-color-on-tertiary); }
|
|
22
|
-
.on-tertiary-text { color: var(--md-sys-color-on-tertiary); }
|
|
23
|
-
.tertiary-container { background-color: var(--md-sys-color-tertiary-container); }
|
|
24
|
-
.tertiary-container-text { color: var(--md-sys-color-tertiary-container); }
|
|
25
|
-
.on-tertiary-container { background-color: var(--md-sys-color-on-tertiary-container); }
|
|
26
|
-
.on-tertiary-container-text { color: var(--md-sys-color-on-tertiary-container); }
|
|
27
|
-
|
|
28
|
-
.error { background-color: var(--md-sys-color-error); }
|
|
29
|
-
.error-text { color: var(--md-sys-color-error); }
|
|
30
|
-
.on-error { background-color: var(--md-sys-color-on-error); }
|
|
31
|
-
.on-error-text { color: var(--md-sys-color-on-error); }
|
|
32
|
-
.error-container { background-color: var(--md-sys-color-error-container); }
|
|
33
|
-
.error-container-text { color: var(--md-sys-color-error-container); }
|
|
34
|
-
.on-error-container { background-color: var(--md-sys-color-on-error-container); }
|
|
35
|
-
.on-error-container-text { color: var(--md-sys-color-on-error-container); }
|
|
36
|
-
|
|
37
|
-
.background { background-color: var(--md-sys-color-background); }
|
|
38
|
-
.background-text { color: var(--md-sys-color-background); }
|
|
39
|
-
.on-background { background-color: var(--md-sys-color-on-background); }
|
|
40
|
-
.on-background-text { color: var(--md-sys-color-on-background); }
|
|
41
|
-
|
|
42
|
-
.surface { background-color: var(--md-sys-color-surface); }
|
|
43
|
-
.surface-text { color: var(--md-sys-color-surface); }
|
|
44
|
-
.on-surface { background-color: var(--md-sys-color-on-surface); }
|
|
45
|
-
.on-surface-text { color: var(--md-sys-color-on-surface); }
|
|
46
|
-
|
|
47
|
-
.surface-variant { background-color: var(--md-sys-color-surface-variant); }
|
|
48
|
-
.surface-variant-text { color: var(--md-sys-color-surface-variant); }
|
|
49
|
-
.on-surface-variant { background-color: var(--md-sys-color-on-surface-variant); }
|
|
50
|
-
.on-surface-variant-text { color: var(--md-sys-color-on-surface-variant); }
|
|
51
|
-
|
|
52
|
-
.outline { background-color: var(--md-sys-color-outline); }
|
|
53
|
-
.outline-text { color: var(--md-sys-color-outline); }
|
|
54
|
-
|
|
55
|
-
.inverse-on-surface { background-color: var(--md-sys-color-inverse-on-surface); }
|
|
56
|
-
.inverse-on-surface-text { color: var(--md-sys-color-inverse-on-surface); }
|
|
57
|
-
|
|
58
|
-
.inverse-surface { background-color: var(--md-sys-color-inverse-surface); }
|
|
59
|
-
.inverse-surface-text { color: var(--md-sys-color-inverse-surface); }
|
|
60
|
-
|
|
61
|
-
.inverse-primary { background-color: var(--md-sys-color-inverse-primary); }
|
|
62
|
-
.inverse-primary-text { color: var(--md-sys-color-inverse-primary); }
|
|
63
|
-
|
|
64
|
-
.shadow { background-color: var(--md-sys-color-shadow); }
|
|
65
|
-
.shadow-text { color: var(--md-sys-color-shadow); }
|
|
66
|
-
|
|
67
|
-
.surface-tint { background-color: var(--md-sys-color-surface-tint); }
|
|
68
|
-
.surface-tint-text { color: var(--md-sys-color-surface-tint); }
|
|
69
|
-
|
|
70
|
-
.outline-variant { background-color: var(--md-sys-color-outline-variant); }
|
|
71
|
-
.outline-variant-text { color: var(--md-sys-color-outline-variant); }
|
|
72
|
-
|
|
73
|
-
.scrim { background-color: var(--md-sys-color-scrim); }
|
|
74
|
-
.scrim-text { color: var(--md-sys-color-scrim); }
|
|
1
|
+
@use "../abstracts" as *;
|
|
2
|
+
|
|
3
|
+
// One fill class and one `-text` foreground class per color role.
|
|
4
|
+
// Generated from $sys-color-roles so this file cannot drift from the
|
|
5
|
+
// token layer. Pair a fill with its `on-*` text class — container
|
|
6
|
+
// roles are fills, not text; `on-*` roles are text/icons, not fills.
|
|
7
|
+
|
|
8
|
+
@each $role in $sys-color-roles {
|
|
9
|
+
.#{$role} {
|
|
10
|
+
background-color: var(--md-sys-color-#{$role});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.#{$role}-text {
|
|
14
|
+
color: var(--md-sys-color-#{$role});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -7,12 +7,10 @@
|
|
|
7
7
|
// Positioning
|
|
8
8
|
.valign-wrapper { display: flex; align-items: center; }
|
|
9
9
|
|
|
10
|
-
.clearfix { clear: both; }
|
|
11
|
-
|
|
12
10
|
// Text alignment
|
|
13
11
|
.left-align { text-align: left; }
|
|
14
12
|
.right-align { text-align: right }
|
|
15
|
-
.center
|
|
13
|
+
.center-align { text-align: center; }
|
|
16
14
|
|
|
17
15
|
// TODO: Remove this
|
|
18
16
|
.left { float: left !important; }
|
|
@@ -38,8 +38,3 @@ $typescale-roles: (
|
|
|
38
38
|
.upper { text-transform: uppercase; }
|
|
39
39
|
.lower { text-transform: lowercase; }
|
|
40
40
|
.capitalize { text-transform: capitalize; }
|
|
41
|
-
|
|
42
|
-
// Body-size aliases when the element is not a <p> / <small>.
|
|
43
|
-
.large-text { @include typescale("body-large"); }
|
|
44
|
-
.medium-text { @include typescale("body-medium"); }
|
|
45
|
-
.small-text { @include typescale("body-small"); }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@use "../abstracts" as *;
|
|
2
2
|
|
|
3
3
|
// Showing and hiding, globally and per breakpoint.
|
|
4
|
-
//
|
|
4
|
+
// Queries come from bp-up / bp-down / bp-between in abstracts/_breakpoints.scss.
|
|
5
5
|
|
|
6
6
|
.hide { display: none !important; }
|
|
7
7
|
|
|
8
|
-
.hide-on-small-only
|
|
8
|
+
.hide-on-small-only {
|
|
9
9
|
@include bp-down("small") { display: none !important; }
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -31,10 +31,18 @@
|
|
|
31
31
|
@include bp-up("xlarge") { display: none !important; }
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.hide-on-xxl-only {
|
|
35
|
+
@include bp-up("xxlarge") { display: none !important; }
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
.show-on-extra-large {
|
|
35
39
|
@include bp-up("xlarge") { display: block !important; }
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
.show-on-xxl {
|
|
43
|
+
@include bp-up("xxlarge") { display: block !important; }
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
.show-on-large {
|
|
39
47
|
@include bp-up("large") { display: block !important; }
|
|
40
48
|
}
|