UNPKG

10.5 kBCSSView Raw
1/**
2 * Mixin that creates a new stacking context.
3 * see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
4 */
5/**
6 * This mixin hides an element visually.
7 * That means it's still accessible for screen-readers but not visible in view.
8 */
9/**
10 * Forces an element to grow to fit floated contents; used as as an alternative to
11 * `overflow: hidden;` because it doesn't cut off contents.
12 */
13/**
14 * A mixin, which generates temporary ink ripple on a given component.
15 * When $bindToParent is set to true, it will check for the focused class on the same selector as you included
16 * that mixin.
17 * It is also possible to specify the color palette of the temporary ripple. By default it uses the
18 * accent palette for its background.
19 */
20/** The width/height of the checkbox element. */
21/** The width of the line used to draw the checkmark / mixedmark. */
22/** The width of the checkbox border shown when the checkbox is unchecked. */
23/** The color of the checkbox border. */
24/** The color of the checkbox's checkmark / mixedmark. */
25/** The color that is used as the checkbox background when it is checked. */
26/** The base duration used for the majority of transitions for the checkbox. */
27/** The amount of spacing between the checkbox and its label. */
28/**
29 * Fades in the background of the checkbox when it goes from unchecked -> {checked,indeterminate}.
30 */
31@keyframes md-checkbox-fade-in-background {
32 0% {
33 opacity: 0; }
34 50% {
35 opacity: 1; } }
36
37/**
38 * Fades out the background of the checkbox when it goes from {checked,indeterminate} -> unchecked.
39 */
40@keyframes md-checkbox-fade-out-background {
41 0%, 50% {
42 opacity: 1; }
43 100% {
44 opacity: 0; } }
45
46/**
47 * "Draws" in the checkmark when the checkbox goes from unchecked -> checked.
48 */
49@keyframes md-checkbox-unchecked-checked-checkmark-path {
50 0%, 50% {
51 stroke-dashoffset: 22.91026; }
52 50% {
53 animation-timing-function: cubic-bezier(0, 0, 0.2, 0.1); }
54 100% {
55 stroke-dashoffset: 0; } }
56
57/**
58 * Horizontally expands the mixedmark when the checkbox goes from unchecked -> indeterminate.
59 */
60@keyframes md-checkbox-unchecked-indeterminate-mixedmark {
61 0%, 68.2% {
62 transform: scaleX(0); }
63 68.2% {
64 animation-timing-function: cubic-bezier(0, 0, 0, 1); }
65 100% {
66 transform: scaleX(1); } }
67
68/**
69 * "Erases" the checkmark when the checkbox goes from checked -> unchecked.
70 */
71@keyframes md-checkbox-checked-unchecked-checkmark-path {
72 from {
73 animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
74 stroke-dashoffset: 0; }
75 to {
76 stroke-dashoffset: -22.91026; } }
77
78/**
79 * Rotates and fades out the checkmark when the checkbox goes from checked -> indeterminate. This
80 * animation helps provide the illusion of the checkmark "morphing" into the mixedmark.
81 */
82@keyframes md-checkbox-checked-indeterminate-checkmark {
83 from {
84 animation-timing-function: cubic-bezier(0, 0, 0.2, 0.1);
85 opacity: 1;
86 transform: rotate(0deg); }
87 to {
88 opacity: 0;
89 transform: rotate(45deg); } }
90
91/**
92 * Rotates and fades the checkmark back into position when the checkbox goes from indeterminate ->
93 * checked. This animation helps provide the illusion that the mixedmark is "morphing" into the
94 * checkmark.
95 */
96@keyframes md-checkbox-indeterminate-checked-checkmark {
97 from {
98 animation-timing-function: cubic-bezier(0.14, 0, 0, 1);
99 opacity: 0;
100 transform: rotate(45deg); }
101 to {
102 opacity: 1;
103 transform: rotate(360deg); } }
104
105/**
106 * Rotates and fades in the mixedmark when the checkbox goes from checked -> indeterminate. This
107 * animation, similar to md-checkbox-checked-indeterminate-checkmark, helps provide an illusion
108 * of "morphing" from checkmark -> mixedmark.
109 */
110@keyframes md-checkbox-checked-indeterminate-mixedmark {
111 from {
112 animation-timing-function: cubic-bezier(0, 0, 0.2, 0.1);
113 opacity: 0;
114 transform: rotate(-45deg); }
115 to {
116 opacity: 1;
117 transform: rotate(0deg); } }
118
119/**
120 * Rotates and fades out the mixedmark when the checkbox goes from indeterminate -> checked. This
121 * animation, similar to md-checkbox-indeterminate-checked-checkmark, helps provide an illusion
122 * of "morphing" from mixedmark -> checkmark.
123 */
124@keyframes md-checkbox-indeterminate-checked-mixedmark {
125 from {
126 animation-timing-function: cubic-bezier(0.14, 0, 0, 1);
127 opacity: 1;
128 transform: rotate(0deg); }
129 to {
130 opacity: 0;
131 transform: rotate(315deg); } }
132
133/**
134 * Horizontally collapses and fades out the mixedmark when the checkbox goes from indeterminate ->
135 * unchecked.
136 */
137@keyframes md-checkbox-indeterminate-unchecked-mixedmark {
138 0% {
139 animation-timing-function: linear;
140 opacity: 1;
141 transform: scaleX(1); }
142 32.8%, 100% {
143 opacity: 0;
144 transform: scaleX(0); } }
145
146/**
147 * Applied to elements that cover the checkbox's entire inner container.
148 */
149.md-checkbox-frame, .md-checkbox-background, .md-checkbox-checkmark {
150 bottom: 0;
151 left: 0;
152 position: absolute;
153 right: 0;
154 top: 0; }
155
156/**
157 * Applied to elements that are considered "marks" within the checkbox, e.g. the checkmark and
158 * the mixedmark.
159 */
160.md-checkbox-checkmark, .md-checkbox-mixedmark {
161 width: calc(100% - 4px); }
162
163/**
164 * Applied to elements that appear to make up the outer box of the checkmark, such as the frame
165 * that contains the border and the actual background element that contains the marks.
166 */
167.md-checkbox-frame, .md-checkbox-background {
168 border-radius: 2px;
169 box-sizing: border-box;
170 pointer-events: none; }
171
172md-checkbox {
173 cursor: pointer; }
174
175.md-checkbox-layout {
176 cursor: inherit;
177 align-items: baseline;
178 display: inline-flex; }
179
180.md-checkbox-inner-container {
181 display: inline-block;
182 height: 20px;
183 line-height: 0;
184 margin: auto;
185 margin-right: 8px;
186 order: 0;
187 position: relative;
188 vertical-align: middle;
189 white-space: nowrap;
190 width: 20px; }
191 [dir='rtl'] .md-checkbox-inner-container {
192 margin-left: 8px;
193 margin-right: auto; }
194
195.md-checkbox-layout .md-checkbox-label {
196 line-height: 24px; }
197
198.md-checkbox-frame {
199 background-color: transparent;
200 border: 2px solid rgba(0, 0, 0, 0.54);
201 transition: border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);
202 will-change: border-color; }
203
204.md-checkbox-background {
205 align-items: center;
206 display: inline-flex;
207 justify-content: center;
208 transition: background-color 90ms cubic-bezier(0, 0, 0.2, 0.1), opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);
209 will-change: background-color, opacity; }
210
211.md-checkbox-checkmark {
212 fill: #fafafa;
213 width: 100%; }
214
215.md-checkbox-checkmark-path {
216 stroke: #fafafa !important;
217 stroke-dashoffset: 22.91026;
218 stroke-dasharray: 22.91026;
219 stroke-width: 2.66667px; }
220
221.md-checkbox-mixedmark {
222 background-color: #fafafa;
223 height: 2px;
224 opacity: 0;
225 transform: scaleX(0) rotate(0deg); }
226
227.md-checkbox-align-end .md-checkbox-inner-container {
228 order: 1;
229 margin-left: 8px;
230 margin-right: auto; }
231 [dir='rtl'] .md-checkbox-align-end .md-checkbox-inner-container {
232 margin-left: auto;
233 margin-right: 8px; }
234
235.md-checkbox-checked .md-checkbox-checkmark {
236 opacity: 1; }
237
238.md-checkbox-checked .md-checkbox-checkmark-path {
239 stroke-dashoffset: 0; }
240
241.md-checkbox-checked .md-checkbox-mixedmark {
242 transform: scaleX(1) rotate(-45deg); }
243
244.md-checkbox-checked .md-checkbox-background {
245 background-color: #9c27b0; }
246
247.md-checkbox-indeterminate .md-checkbox-background {
248 background-color: #9c27b0; }
249
250.md-checkbox-indeterminate .md-checkbox-checkmark {
251 opacity: 0;
252 transform: rotate(45deg); }
253
254.md-checkbox-indeterminate .md-checkbox-checkmark-path {
255 stroke-dashoffset: 0; }
256
257.md-checkbox-indeterminate .md-checkbox-mixedmark {
258 opacity: 1;
259 transform: scaleX(1) rotate(0deg); }
260
261.md-checkbox-unchecked .md-checkbox-background {
262 background-color: transparent; }
263
264.md-checkbox-disabled {
265 cursor: default; }
266 .md-checkbox-disabled.md-checkbox-checked .md-checkbox-background, .md-checkbox-disabled.md-checkbox-indeterminate .md-checkbox-background {
267 background-color: #b0b0b0; }
268 .md-checkbox-disabled:not(.md-checkbox-checked) .md-checkbox-frame {
269 border-color: #b0b0b0; }
270
271.md-checkbox-anim-unchecked-checked .md-checkbox-background {
272 animation: 180ms linear 0ms md-checkbox-fade-in-background; }
273
274.md-checkbox-anim-unchecked-checked .md-checkbox-checkmark-path {
275 animation: 180ms linear 0ms md-checkbox-unchecked-checked-checkmark-path; }
276
277.md-checkbox-anim-unchecked-indeterminate .md-checkbox-background {
278 animation: 180ms linear 0ms md-checkbox-fade-in-background; }
279
280.md-checkbox-anim-unchecked-indeterminate .md-checkbox-mixedmark {
281 animation: 90ms linear 0ms md-checkbox-unchecked-indeterminate-mixedmark; }
282
283.md-checkbox-anim-checked-unchecked .md-checkbox-background {
284 animation: 180ms linear 0ms md-checkbox-fade-out-background; }
285
286.md-checkbox-anim-checked-unchecked .md-checkbox-checkmark-path {
287 animation: 90ms linear 0ms md-checkbox-checked-unchecked-checkmark-path; }
288
289.md-checkbox-anim-checked-indeterminate .md-checkbox-checkmark {
290 animation: 90ms linear 0ms md-checkbox-checked-indeterminate-checkmark; }
291
292.md-checkbox-anim-checked-indeterminate .md-checkbox-mixedmark {
293 animation: 90ms linear 0ms md-checkbox-checked-indeterminate-mixedmark; }
294
295.md-checkbox-anim-indeterminate-checked .md-checkbox-checkmark {
296 animation: 500ms linear 0ms md-checkbox-indeterminate-checked-checkmark; }
297
298.md-checkbox-anim-indeterminate-checked .md-checkbox-mixedmark {
299 animation: 500ms linear 0ms md-checkbox-indeterminate-checked-mixedmark; }
300
301.md-checkbox-anim-indeterminate-unchecked .md-checkbox-background {
302 animation: 180ms linear 0ms md-checkbox-fade-out-background; }
303
304.md-checkbox-anim-indeterminate-unchecked .md-checkbox-mixedmark {
305 animation: 300ms linear 0ms md-checkbox-indeterminate-unchecked-mixedmark; }
306
307.md-checkbox-input {
308 border: 0;
309 clip: rect(0 0 0 0);
310 height: 1px;
311 margin: -1px;
312 overflow: hidden;
313 padding: 0;
314 position: absolute;
315 text-transform: none;
316 width: 1px; }
317
318.md-ink-ripple {
319 border-radius: 50%;
320 opacity: 0;
321 height: 48px;
322 left: 50%;
323 overflow: hidden;
324 pointer-events: none;
325 position: absolute;
326 top: 50%;
327 transform: translate(-50%, -50%);
328 transition: opacity ease 280ms, background-color ease 280ms;
329 width: 48px; }
330
331.md-checkbox-focused .md-ink-ripple {
332 opacity: 1;
333 background-color: rgba(156, 39, 176, 0.26); }
334
335.md-checkbox-disabled .md-ink-ripple {
336 background-color: #000; }
337
338/*# sourceMappingURL=checkbox.css.map */