material 3.0.0 → 3.0.1
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/README.md +3 -5
- package/dist/components/menu/features/position.js +6 -0
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/css/text-field.css +1 -1
- package/dist/elements/css/text-field.js +1 -1
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +2 -2
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +2 -2
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +2 -2
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +2 -2
- package/dist/elements/preupgrade.js +1 -1
- package/dist/package.json +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +1 -1
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +2 -2
- package/dist/styles/timepicker.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/themes/autumn-contrast.css +1 -1
- package/dist/themes/autumn.css +1 -1
- package/dist/themes/baseline-contrast.css +1 -1
- package/dist/themes/baseline.css +1 -1
- package/dist/themes/brownbeige-contrast.css +1 -1
- package/dist/themes/brownbeige.css +1 -1
- package/dist/themes/content-contrast.css +1 -1
- package/dist/themes/content.css +1 -1
- package/dist/themes/desert-contrast.css +1 -1
- package/dist/themes/desert.css +1 -1
- package/dist/themes/expressive-contrast.css +1 -1
- package/dist/themes/expressive.css +1 -1
- package/dist/themes/fidelity-contrast.css +1 -1
- package/dist/themes/fidelity.css +1 -1
- package/dist/themes/forest-contrast.css +1 -1
- package/dist/themes/forest.css +1 -1
- package/dist/themes/fruit-salad-contrast.css +1 -1
- package/dist/themes/fruit-salad.css +1 -1
- package/dist/themes/highcontrast-contrast.css +1 -1
- package/dist/themes/highcontrast.css +1 -1
- package/dist/themes/monochrome-contrast.css +1 -1
- package/dist/themes/monochrome.css +1 -1
- package/dist/themes/neutral-contrast.css +1 -1
- package/dist/themes/neutral.css +1 -1
- package/dist/themes/ocean-contrast.css +1 -1
- package/dist/themes/ocean.css +1 -1
- package/dist/themes/rainbow-contrast.css +1 -1
- package/dist/themes/rainbow.css +1 -1
- package/dist/themes/sageivory-contrast.css +1 -1
- package/dist/themes/sageivory.css +1 -1
- package/dist/themes/spring-contrast.css +1 -1
- package/dist/themes/spring.css +1 -1
- package/dist/themes/summer-contrast.css +1 -1
- package/dist/themes/summer.css +1 -1
- package/dist/themes/sunset-contrast.css +1 -1
- package/dist/themes/sunset.css +1 -1
- package/dist/themes/tealcaramel-contrast.css +1 -1
- package/dist/themes/tealcaramel.css +1 -1
- package/dist/themes/vibrant-contrast.css +1 -1
- package/dist/themes/vibrant.css +1 -1
- package/package.json +1 -1
- package/src/styles/components/_menu.scss +32 -15
- package/src/styles/components/_text-field.scss +19 -0
- package/src/styles/elements/_button-group.scss +15 -0
- package/src/styles/elements/_slider.scss +39 -1
- package/src/styles/elements/_text-field.scss +140 -43
|
@@ -1,83 +1,180 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// <m-text-field> keeps the consumer's line box around its inline field,
|
|
2
|
+
// just as the upgraded host does. The surrogate carries the field's own
|
|
3
|
+
// typography, box and baseline; a tall inherited strut can enlarge the host.
|
|
4
4
|
@use 'config' as c;
|
|
5
5
|
@use 'field';
|
|
6
6
|
@use '../abstract/variables' as v;
|
|
7
|
+
@use '../abstract/mixins' as m;
|
|
8
|
+
@use '../abstract/theme' as t;
|
|
7
9
|
|
|
8
10
|
@include c.host('text-field') {
|
|
9
|
-
|
|
11
|
+
display: inline-block;
|
|
12
|
+
position: relative;
|
|
13
|
+
width: v.text-field('width');
|
|
10
14
|
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
// The value (or a space holding its baseline) paints the inner field.
|
|
16
|
+
// Its half-pixel inset matches the input's baseline. The outer host must
|
|
17
|
+
// retain the page's typography, including the space below that baseline.
|
|
18
|
+
&::before {
|
|
19
|
+
content: attr(value) ' ';
|
|
20
|
+
display: inline-block;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: v.text-field('height');
|
|
24
|
+
padding: 24.5px v.text-field('padding-horizontal') 0;
|
|
25
|
+
border-radius: v.text-field('border-radius') v.text-field('border-radius') 0 0;
|
|
26
|
+
border-bottom: v.text-field('border-width') solid t.color('on-surface-variant');
|
|
27
|
+
background-color: t.color('surface-container-highest');
|
|
28
|
+
color: t.color('on-surface');
|
|
29
|
+
white-space: pre;
|
|
30
|
+
// Clip the value without replacing its baseline with the bottom edge.
|
|
31
|
+
overflow: clip;
|
|
32
|
+
@include m.typography('body-large');
|
|
20
33
|
}
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
&:not([label])::before {
|
|
36
|
+
padding-top: 16.5px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[variant='outlined']::before {
|
|
40
|
+
padding-top: 15.5px;
|
|
41
|
+
border: v.text-field('border-width') solid t.color('outline');
|
|
42
|
+
border-radius: v.text-field('border-radius');
|
|
43
|
+
background: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&[density='compact'] {
|
|
47
|
+
&::before {
|
|
48
|
+
height: 40px;
|
|
49
|
+
padding-top: 13.5px;
|
|
50
|
+
@include m.typography('body-medium');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:not([label])::before { padding-top: 10px; }
|
|
54
|
+
&[variant='outlined']::before { padding-top: 9px; }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Reserve the helper/counter row under the field, keeping the fill and
|
|
58
|
+
// indicator inside the field's own box.
|
|
59
|
+
&[supporting-text]:not([supporting-text='']),
|
|
60
|
+
&[maxlength] {
|
|
61
|
+
&::before {
|
|
62
|
+
height: calc(#{v.text-field('height')} + #{field.$supporting-row});
|
|
63
|
+
border-bottom: field.$supporting-row solid transparent;
|
|
64
|
+
background-clip: padding-box;
|
|
65
|
+
background-image: linear-gradient(to top, #{t.color('on-surface-variant')} v.text-field('border-width'), transparent v.text-field('border-width'));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&[variant='outlined']::before {
|
|
69
|
+
padding-top: calc(15.5px + #{v.text-field('border-width')});
|
|
70
|
+
padding-left: calc(#{v.text-field('padding-horizontal')} + #{v.text-field('border-width')});
|
|
71
|
+
border-width: 0 0 field.$supporting-row;
|
|
72
|
+
border-radius: v.text-field('border-radius') / v.text-field('border-radius') v.text-field('border-radius') calc(#{v.text-field('border-radius')} + #{field.$supporting-row}) calc(#{v.text-field('border-radius')} + #{field.$supporting-row});
|
|
73
|
+
background-image: none;
|
|
74
|
+
box-shadow: inset 0 0 0 v.text-field('border-width') t.color('outline');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[density='compact']::before {
|
|
78
|
+
height: calc(40px + #{field.$supporting-row});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&[label]::after {
|
|
83
|
+
content: attr(label);
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: v.text-field('padding-vertical');
|
|
87
|
+
left: v.text-field('padding-horizontal');
|
|
88
|
+
color: t.color('on-surface-variant');
|
|
89
|
+
@include m.typography('body-large');
|
|
30
90
|
}
|
|
31
91
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
92
|
+
&[label][value]:not([value=''])::after {
|
|
93
|
+
top: 8px;
|
|
94
|
+
@include m.typography('body-small');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&[variant='outlined'][label][value]:not([value=''])::after {
|
|
98
|
+
top: -8px;
|
|
99
|
+
padding: 0 4px;
|
|
100
|
+
left: 12px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&[density='compact']::after {
|
|
104
|
+
top: 10px;
|
|
105
|
+
@include m.typography('body-medium');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Multiline reserves the textarea's box and first line. Compact multiline
|
|
109
|
+
// keeps the compact single-line height, as the upgraded input does.
|
|
37
110
|
&[type='multiline'] {
|
|
38
|
-
|
|
39
|
-
|
|
111
|
+
&::before {
|
|
112
|
+
height: v.text-field('height-multiline');
|
|
113
|
+
padding-top: v.text-field('padding-top-multiline');
|
|
114
|
+
}
|
|
40
115
|
|
|
41
|
-
&[label] {
|
|
116
|
+
&[label]::before {
|
|
42
117
|
padding-top: v.text-field('padding-top-multiline-label');
|
|
43
118
|
}
|
|
44
119
|
|
|
45
|
-
&[variant='outlined'] {
|
|
120
|
+
&[variant='outlined']::before {
|
|
46
121
|
padding-top: calc(#{v.text-field('padding-top-multiline')} - #{v.text-field('border-width')});
|
|
47
122
|
}
|
|
48
123
|
|
|
49
|
-
// Compact multiline stays the compact field (40px), with the compact
|
|
50
|
-
// single-line field's first line.
|
|
51
124
|
&[density='compact'] {
|
|
52
|
-
|
|
53
|
-
|
|
125
|
+
&::before {
|
|
126
|
+
height: 40px;
|
|
127
|
+
padding-top: v.text-field('padding-top-multiline-compact');
|
|
128
|
+
}
|
|
54
129
|
|
|
55
|
-
&[label] {
|
|
130
|
+
&[label]::before {
|
|
56
131
|
padding-top: v.text-field('padding-top-multiline-compact-label');
|
|
57
132
|
}
|
|
58
133
|
|
|
59
|
-
&[variant='outlined'] {
|
|
134
|
+
&[variant='outlined']::before {
|
|
60
135
|
padding-top: calc(#{v.text-field('padding-top-multiline-compact')} - #{v.text-field('border-width')});
|
|
61
136
|
}
|
|
62
137
|
}
|
|
63
138
|
|
|
64
|
-
// The supporting row is the single-line field's. Outlined drops its top
|
|
65
|
-
// border for an inset ring, so the whole inset is padding there.
|
|
66
139
|
&[supporting-text]:not([supporting-text='']),
|
|
67
140
|
&[maxlength] {
|
|
68
|
-
|
|
141
|
+
&::before {
|
|
142
|
+
height: calc(#{v.text-field('height-multiline')} + #{field.$supporting-row});
|
|
143
|
+
}
|
|
69
144
|
|
|
70
|
-
&[variant='outlined'] {
|
|
145
|
+
&[variant='outlined']::before {
|
|
71
146
|
padding-top: v.text-field('padding-top-multiline');
|
|
72
147
|
}
|
|
73
148
|
|
|
74
149
|
&[density='compact'] {
|
|
75
|
-
height: calc(40px + #{field.$supporting-row});
|
|
76
|
-
|
|
77
|
-
&[variant='outlined'] {
|
|
150
|
+
&::before { height: calc(40px + #{field.$supporting-row}); }
|
|
151
|
+
&[variant='outlined']::before {
|
|
78
152
|
padding-top: v.text-field('padding-top-multiline-compact');
|
|
79
153
|
}
|
|
80
154
|
}
|
|
81
155
|
}
|
|
82
156
|
}
|
|
157
|
+
|
|
158
|
+
// A password or hidden field paints no value (#53): the value attribute can
|
|
159
|
+
// hold a password or a token in clear text, and the shared rule above paints
|
|
160
|
+
// it for every type. The space is the empty field's line box, so a password's
|
|
161
|
+
// box does not move at upgrade; no mask either — its length is information
|
|
162
|
+
// too. `i`: HTML reads an input's type case-insensitively, so
|
|
163
|
+
// `type="PASSWORD"` upgrades to a masked input and must not paint here.
|
|
164
|
+
&[type='password' i]::before,
|
|
165
|
+
&[type='hidden' i]::before {
|
|
166
|
+
content: ' ';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// A hidden field takes no space, before upgrade or after: the upgraded host
|
|
170
|
+
// is not rendered at all — a host rule for `type="hidden"` in the element's
|
|
171
|
+
// host styles, as for `[hidden]` — so reserving a box here would move the
|
|
172
|
+
// page twice, at paint and at upgrade. `display: none` is that, and with it
|
|
173
|
+
// the field's chrome never renders either; the value still submits with the
|
|
174
|
+
// form, the element being form-associated.
|
|
175
|
+
&[type='hidden' i] {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
> * { display: none; }
|
|
83
180
|
}
|