material_components_web-sass 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +97 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/material_components_web-sass.rb +52 -0
- data/lib/material_components_web/sass/engine.rb +18 -0
- data/lib/material_components_web/sass/version.rb +5 -0
- data/material_components_web-sass.gemspec +32 -0
- data/vendor/assets/fonts/material-icons/LICENSE +202 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.eot +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.ttf +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff2 +0 -0
- data/vendor/assets/fonts/roboto/LICENSE.txt +202 -0
- data/vendor/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Light.ttf +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/vendor/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/vendor/assets/javascripts/material-components-web.js +5492 -0
- data/vendor/assets/stylesheets/@material/animation/_functions.scss +25 -0
- data/vendor/assets/stylesheets/@material/animation/_mixins.scss +29 -0
- data/vendor/assets/stylesheets/@material/animation/_variables.scss +19 -0
- data/vendor/assets/stylesheets/@material/animation/mdc-animation.scss +31 -0
- data/vendor/assets/stylesheets/@material/button/mdc-button.scss +199 -0
- data/vendor/assets/stylesheets/@material/card/mdc-card.scss +179 -0
- data/vendor/assets/stylesheets/@material/checkbox/_keyframes.scss +180 -0
- data/vendor/assets/stylesheets/@material/checkbox/_variables.scss +31 -0
- data/vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss +310 -0
- data/vendor/assets/stylesheets/@material/drawer/_mixins.scss +145 -0
- data/vendor/assets/stylesheets/@material/drawer/mdc-drawer.scss +18 -0
- data/vendor/assets/stylesheets/@material/drawer/permanent/mdc-permanent-drawer.scss +54 -0
- data/vendor/assets/stylesheets/@material/drawer/temporary/mdc-temporary-drawer.scss +134 -0
- data/vendor/assets/stylesheets/@material/elevation/_mixins.scss +68 -0
- data/vendor/assets/stylesheets/@material/elevation/_variables.scss +122 -0
- data/vendor/assets/stylesheets/@material/elevation/mdc-elevation.scss +27 -0
- data/vendor/assets/stylesheets/@material/fab/mdc-fab.scss +122 -0
- data/vendor/assets/stylesheets/@material/fonts/material-icons.scss +36 -0
- data/vendor/assets/stylesheets/@material/fonts/roboto.scss +45 -0
- data/vendor/assets/stylesheets/@material/form-field/mdc-form-field.scss +64 -0
- data/vendor/assets/stylesheets/@material/icon-toggle/mdc-icon-toggle.scss +133 -0
- data/vendor/assets/stylesheets/@material/list/mdc-list.scss +207 -0
- data/vendor/assets/stylesheets/@material/menu/mdc-menu.scss +22 -0
- data/vendor/assets/stylesheets/@material/menu/simple/mdc-simple-menu.scss +194 -0
- data/vendor/assets/stylesheets/@material/radio/mdc-radio.scss +198 -0
- data/vendor/assets/stylesheets/@material/ripple/_keyframes.scss +61 -0
- data/vendor/assets/stylesheets/@material/ripple/_mixins.scss +196 -0
- data/vendor/assets/stylesheets/@material/ripple/_variables.scss +17 -0
- data/vendor/assets/stylesheets/@material/ripple/mdc-ripple.scss +80 -0
- data/vendor/assets/stylesheets/@material/rtl/_mixins.scss +251 -0
- data/vendor/assets/stylesheets/@material/select/mdc-select.scss +174 -0
- data/vendor/assets/stylesheets/@material/snackbar/_variables.scss +22 -0
- data/vendor/assets/stylesheets/@material/snackbar/mdc-snackbar.scss +126 -0
- data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +512 -0
- data/vendor/assets/stylesheets/@material/theme/_constants.scss +285 -0
- data/vendor/assets/stylesheets/@material/theme/_functions.scss +64 -0
- data/vendor/assets/stylesheets/@material/theme/_mixins.scss +104 -0
- data/vendor/assets/stylesheets/@material/theme/_variables.scss +80 -0
- data/vendor/assets/stylesheets/@material/theme/mdc-theme.scss +43 -0
- data/vendor/assets/stylesheets/@material/typography/_mixins.scss +45 -0
- data/vendor/assets/stylesheets/@material/typography/_variables.scss +109 -0
- data/vendor/assets/stylesheets/@material/typography/mdc-typography.scss +32 -0
- data/vendor/assets/stylesheets/_material-components-web.scss +36 -0
- metadata +195 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
@import "@material/animation/functions";
|
18
|
+
@import "@material/typography/mixins";
|
19
|
+
@import "@material/theme/mixins";
|
20
|
+
@import "@material/rtl/mixins";
|
21
|
+
|
22
|
+
@mixin mdc-select-dd-arrow-svg-bg_($fill-hex-number: 000000, $opacity: .54) {
|
23
|
+
// stylelint-disable scss/dollar-variable-pattern
|
24
|
+
background-image: url(data:image/svg+xml,%3Csvg%20width%3D%2210px%22%20height%3D%225px%22%20viewBox%3D%227%2010%2010%205%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%0A%20%20%20%20%3Cpolygon%20id%3D%22Shape%22%20stroke%3D%22none%22%20fill%3D%22%23#{$fill-hex-number}%22%20fill-rule%3D%22evenodd%22%20opacity%3D%22#{$opacity}%22%20points%3D%227%2010%2012%2015%2017%2010%22%3E%3C%2Fpolygon%3E%0A%3C%2Fsvg%3E);
|
25
|
+
// stylelint-enable scss/dollar-variable-pattern
|
26
|
+
}
|
27
|
+
|
28
|
+
// postcss-bem-linter: define select
|
29
|
+
.mdc-select {
|
30
|
+
@include mdc-typography(subheading2);
|
31
|
+
@include mdc-theme-prop(color, text-primary-on-light);
|
32
|
+
@include mdc-rtl-reflexive-box(padding, right, 24px);
|
33
|
+
|
34
|
+
// Resets for <select> element
|
35
|
+
appearance: none;
|
36
|
+
|
37
|
+
&::-ms-expand {
|
38
|
+
display: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
display: inline-flex;
|
42
|
+
align-items: center;
|
43
|
+
justify-content: flex-start;
|
44
|
+
height: 32px;
|
45
|
+
transition:
|
46
|
+
mdc-animation-exit(border-bottom-color, 150ms),
|
47
|
+
mdc-animation-exit(background-color, 150ms);
|
48
|
+
border: none;
|
49
|
+
border-bottom: 1px solid rgba(black, .12);
|
50
|
+
border-radius: 0;
|
51
|
+
background: none;
|
52
|
+
background-repeat: no-repeat;
|
53
|
+
background-position: right center;
|
54
|
+
|
55
|
+
@include mdc-select-dd-arrow-svg-bg_;
|
56
|
+
|
57
|
+
font-family: Roboto, sans-serif;
|
58
|
+
font-size: .936rem;
|
59
|
+
cursor: pointer;
|
60
|
+
|
61
|
+
&:focus {
|
62
|
+
@include mdc-theme-prop(border-bottom-color, primary);
|
63
|
+
|
64
|
+
outline: none;
|
65
|
+
background-color: rgba(black, .06);
|
66
|
+
}
|
67
|
+
|
68
|
+
@include mdc-rtl {
|
69
|
+
background-position: left center;
|
70
|
+
}
|
71
|
+
|
72
|
+
@include mdc-theme-dark {
|
73
|
+
@include mdc-theme-prop(color, text-primary-on-dark);
|
74
|
+
@include mdc-select-dd-arrow-svg-bg_(ffffff);
|
75
|
+
|
76
|
+
border-bottom: 1px solid rgba(white, .12);
|
77
|
+
|
78
|
+
&:focus {
|
79
|
+
@include mdc-theme-prop(border-bottom-color, primary);
|
80
|
+
|
81
|
+
background-color: rgba(white, .09);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
&__menu {
|
86
|
+
position: fixed;
|
87
|
+
top: 0;
|
88
|
+
left: 0;
|
89
|
+
max-height: 100%;
|
90
|
+
transform-origin: center center;
|
91
|
+
overflow-y: scroll;
|
92
|
+
}
|
93
|
+
|
94
|
+
&__selected-text {
|
95
|
+
transition:
|
96
|
+
mdc-animation-exit(opacity, 125ms),
|
97
|
+
mdc-animation-exit(transform, 125ms);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
.mdc-select--open {
|
102
|
+
.mdc-select__selected-text {
|
103
|
+
transform: translateY(8px);
|
104
|
+
transition:
|
105
|
+
mdc-animation-enter(opacity, 125ms, 125ms),
|
106
|
+
mdc-animation-enter(transform, 125ms, 125ms);
|
107
|
+
opacity: 0;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
.mdc-select--disabled,
|
112
|
+
.mdc-select[disabled] {
|
113
|
+
@include mdc-theme-prop(color, text-disabled-on-light);
|
114
|
+
@include mdc-select-dd-arrow-svg-bg_(000000, .38);
|
115
|
+
|
116
|
+
border-bottom-style: dotted;
|
117
|
+
cursor: default;
|
118
|
+
pointer-events: none;
|
119
|
+
// Imitate native disabled functionality
|
120
|
+
user-select: none;
|
121
|
+
|
122
|
+
@include mdc-theme-dark(".mdc-select", true) {
|
123
|
+
@include mdc-theme-prop(color, text-disabled-on-dark);
|
124
|
+
@include mdc-select-dd-arrow-svg-bg_(ffffff, .38);
|
125
|
+
|
126
|
+
border-bottom: 1px dotted rgba(white, .38);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
// postcss-bem-linter: end
|
131
|
+
|
132
|
+
.mdc-select__menu {
|
133
|
+
.mdc-list-item {
|
134
|
+
@include mdc-typography(subheading2);
|
135
|
+
@include mdc-theme-prop(color, text-secondary-on-light);
|
136
|
+
|
137
|
+
&[aria-selected="true"] {
|
138
|
+
@include mdc-theme-prop(color, text-primary-on-light);
|
139
|
+
}
|
140
|
+
|
141
|
+
@include mdc-theme-dark(".mdc-select") {
|
142
|
+
@include mdc-theme-prop(color, text-secondary-on-dark);
|
143
|
+
|
144
|
+
&[aria-selected="true"] {
|
145
|
+
@include mdc-theme-prop(color, text-primary-on-dark);
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
.mdc-list-group,
|
151
|
+
.mdc-list-group > .mdc-list-item:first-child {
|
152
|
+
margin-top: 12px;
|
153
|
+
}
|
154
|
+
|
155
|
+
.mdc-list-group {
|
156
|
+
@include mdc-theme-prop(color, text-hint-on-light);
|
157
|
+
|
158
|
+
font-weight: normal;
|
159
|
+
|
160
|
+
.mdc-list-item {
|
161
|
+
@include mdc-theme-prop(color, text-primary-on-light);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
@include mdc-theme-dark(".mdc-select") {
|
166
|
+
.mdc-list-group {
|
167
|
+
@include mdc-theme-prop(color, text-hint-on-dark);
|
168
|
+
|
169
|
+
.mdc-list-item {
|
170
|
+
@include mdc-theme-prop(color, text-primary-on-dark);
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
// Hard coded since the color is not present in any palette.
|
18
|
+
$mdc-snackbar-background-color: #323232;
|
19
|
+
$mdc-snackbar-foreground-color: white;
|
20
|
+
// TODO: Better spot to pull this breakpoint?
|
21
|
+
//$snackbar-tablet-breakpoint: $grid-tablet-breakpoint;
|
22
|
+
$mdc-snackbar-tablet-breakpoint: 600px;
|
@@ -0,0 +1,126 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2015 Google Inc. All Rights Reserved.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
@import "@material/animation/functions";
|
18
|
+
@import "@material/rtl/mixins";
|
19
|
+
@import "@material/theme/mixins";
|
20
|
+
@import "@material/typography/mixins";
|
21
|
+
@import "./variables";
|
22
|
+
|
23
|
+
/* postcss-bem-linter: define snackbar */
|
24
|
+
.mdc-snackbar {
|
25
|
+
display: flex;
|
26
|
+
position: fixed;
|
27
|
+
bottom: 0;
|
28
|
+
left: 50%;
|
29
|
+
align-items: center;
|
30
|
+
justify-content: flex-start;
|
31
|
+
padding-right: 24px;
|
32
|
+
padding-left: 24px;
|
33
|
+
transform: translate(0, 100%);
|
34
|
+
transition: mdc-animation-exit(transform, .25s);
|
35
|
+
background-color: $mdc-snackbar-background-color;
|
36
|
+
will-change: transform;
|
37
|
+
pointer-events: none;
|
38
|
+
|
39
|
+
@media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) {
|
40
|
+
left: 0;
|
41
|
+
width: calc(100% - 48px);
|
42
|
+
}
|
43
|
+
|
44
|
+
@media (min-width: $mdc-snackbar-tablet-breakpoint) {
|
45
|
+
min-width: 288px;
|
46
|
+
max-width: 568px;
|
47
|
+
transform: translate(-50%, 100%);
|
48
|
+
border-radius: 2px;
|
49
|
+
}
|
50
|
+
|
51
|
+
&--active {
|
52
|
+
transform: translate(0, 0);
|
53
|
+
pointer-events: auto;
|
54
|
+
transition: mdc-animation-enter(transform, .25s);
|
55
|
+
|
56
|
+
@media (min-width: $mdc-snackbar-tablet-breakpoint) {
|
57
|
+
transform: translate(-50%, 0);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
&--action-on-bottom {
|
62
|
+
flex-direction: column;
|
63
|
+
}
|
64
|
+
|
65
|
+
&--action-on-bottom &__text {
|
66
|
+
margin-right: inherit;
|
67
|
+
}
|
68
|
+
|
69
|
+
&--action-on-bottom &__action-wrapper {
|
70
|
+
flex-direction: column;
|
71
|
+
justify-content: flex-start;
|
72
|
+
margin-top: -12px;
|
73
|
+
margin-bottom: 8px;
|
74
|
+
|
75
|
+
@include mdc-rtl-reflexive-box(margin, left, auto);
|
76
|
+
}
|
77
|
+
|
78
|
+
&__text {
|
79
|
+
@include mdc-typography(body1);
|
80
|
+
@include mdc-rtl-reflexive-box(margin, right, auto, ".mdc-snackbar");
|
81
|
+
|
82
|
+
display: flex;
|
83
|
+
align-items: center;
|
84
|
+
height: 48px;
|
85
|
+
transition: mdc-animation-exit(opacity, .3s);
|
86
|
+
color: $mdc-snackbar-foreground-color;
|
87
|
+
opacity: 0;
|
88
|
+
}
|
89
|
+
|
90
|
+
&--multiline &__text {
|
91
|
+
height: 80px;
|
92
|
+
}
|
93
|
+
|
94
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
95
|
+
&--multiline#{&}--action-on-bottom &__text {
|
96
|
+
margin: 0;
|
97
|
+
}
|
98
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
99
|
+
|
100
|
+
&__action-button {
|
101
|
+
@include mdc-theme-prop(color, accent);
|
102
|
+
@include mdc-rtl-reflexive-box(margin, right, -16px, ".mdc-snackbar");
|
103
|
+
|
104
|
+
min-width: auto;
|
105
|
+
height: inherit;
|
106
|
+
transition: mdc-animation-exit(opacity, .3s);
|
107
|
+
opacity: 0;
|
108
|
+
visibility: hidden;
|
109
|
+
|
110
|
+
&::-moz-focus-inner {
|
111
|
+
border: 0;
|
112
|
+
}
|
113
|
+
|
114
|
+
&:not([aria-hidden]) {
|
115
|
+
visibility: inherit;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
&--active &__text,
|
120
|
+
&--active &__action-button:not([aria-hidden]) {
|
121
|
+
transition: mdc-animation-exit(opacity, .3s);
|
122
|
+
opacity: 1;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
/* postcss-bem-linter: end */
|
@@ -0,0 +1,512 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2016 Google Inc. All Rights Reserved.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
@import "@material/animation/variables";
|
18
|
+
@import "@material/rtl/mixins";
|
19
|
+
@import "@material/theme/variables";
|
20
|
+
@import "@material/theme/mixins";
|
21
|
+
@import "@material/typography/mixins";
|
22
|
+
@import "@material/typography/variables";
|
23
|
+
|
24
|
+
$mdc-textfield-error-on-light: #d50000;
|
25
|
+
$mdc-textfield-error-on-dark: #ff6e6e;
|
26
|
+
$mdc-textfield-divider-on-light: rgba(black, .12);
|
27
|
+
$mdc-textfield-divider-on-dark: rgba(white, .12);
|
28
|
+
$mdc-textfield-disabled-border-on-light: rgba(#231f20, .26);
|
29
|
+
$mdc-textfield-disabled-border-on-dark: rgba(white, .3);
|
30
|
+
|
31
|
+
@function mdc-textfield-transition($property) {
|
32
|
+
@return #{$property} 180ms $mdc-animation-fast-out-slow-in-timing-function;
|
33
|
+
}
|
34
|
+
|
35
|
+
/* postcss-bem-linter: define textfield */
|
36
|
+
.mdc-textfield {
|
37
|
+
@include mdc-typography-base;
|
38
|
+
// We use only a subset of the MDC typography values here as changing things such as line-height
|
39
|
+
// affects how the labels are transformed.
|
40
|
+
@each $prop in (font-size, letter-spacing) {
|
41
|
+
#{$prop}: map-get(map-get($mdc-typography-styles, subheading2), $prop);
|
42
|
+
}
|
43
|
+
|
44
|
+
display: inline-block;
|
45
|
+
margin-bottom: 8px;
|
46
|
+
will-change: opacity, transform, color;
|
47
|
+
|
48
|
+
&__input {
|
49
|
+
@include mdc-theme-prop(color, text-primary-on-light);
|
50
|
+
|
51
|
+
padding: 0 0 8px;
|
52
|
+
border: none;
|
53
|
+
background: none;
|
54
|
+
font-size: inherit;
|
55
|
+
appearance: none;
|
56
|
+
|
57
|
+
&::placeholder {
|
58
|
+
@include mdc-theme-prop(color, text-hint-on-light);
|
59
|
+
|
60
|
+
transition: mdc-textfield-transition(color);
|
61
|
+
opacity: 1;
|
62
|
+
}
|
63
|
+
|
64
|
+
&:focus {
|
65
|
+
outline: none;
|
66
|
+
|
67
|
+
&::placeholder {
|
68
|
+
@include mdc-theme-prop(color, text-secondary-on-light);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// Remove red outline on firefox
|
73
|
+
&:invalid {
|
74
|
+
box-shadow: none;
|
75
|
+
}
|
76
|
+
|
77
|
+
@include mdc-theme-dark {
|
78
|
+
color: white;
|
79
|
+
|
80
|
+
&::placeholder {
|
81
|
+
@include mdc-theme-prop(color, text-hint-on-dark);
|
82
|
+
}
|
83
|
+
|
84
|
+
&:focus::placeholder {
|
85
|
+
@include mdc-theme-prop(color, text-secondary-on-dark);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
&__label {
|
91
|
+
@include mdc-theme-prop(color, text-hint-on-light);
|
92
|
+
|
93
|
+
position: absolute;
|
94
|
+
bottom: 8px;
|
95
|
+
left: 0;
|
96
|
+
transform-origin: left top;
|
97
|
+
transition: mdc-textfield-transition(transform), mdc-textfield-transition(color);
|
98
|
+
cursor: text;
|
99
|
+
|
100
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
101
|
+
@include mdc-rtl(".mdc-textfield") {
|
102
|
+
right: 0;
|
103
|
+
left: auto;
|
104
|
+
transform-origin: right top;
|
105
|
+
}
|
106
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
107
|
+
|
108
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
109
|
+
@include mdc-theme-prop(color, text-hint-on-dark);
|
110
|
+
}
|
111
|
+
|
112
|
+
&--float-above {
|
113
|
+
transform: translateY(-100%) scale(.75, .75);
|
114
|
+
cursor: auto;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth) {
|
120
|
+
display: inline-flex;
|
121
|
+
position: relative;
|
122
|
+
box-sizing: border-box;
|
123
|
+
align-items: flex-end;
|
124
|
+
margin-top: 16px;
|
125
|
+
|
126
|
+
&:not(.mdc-textfield--multiline) {
|
127
|
+
height: 48px;
|
128
|
+
|
129
|
+
&::after {
|
130
|
+
position: absolute;
|
131
|
+
bottom: 0;
|
132
|
+
left: 0;
|
133
|
+
width: 100%;
|
134
|
+
height: 1px;
|
135
|
+
transform: translateY(50%) scaleY(1);
|
136
|
+
transform-origin: center bottom;
|
137
|
+
transition: mdc-textfield-transition(background-color), mdc-textfield-transition(transform);
|
138
|
+
background-color: $mdc-textfield-divider-on-light;
|
139
|
+
content: "";
|
140
|
+
|
141
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
142
|
+
background-color: $mdc-textfield-divider-on-dark;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
.mdc-textfield__label {
|
148
|
+
pointer-events: none;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
.mdc-textfield--focused {
|
153
|
+
@mixin mdc-textfield-after-styles {
|
154
|
+
@include mdc-theme-prop(background-color, primary);
|
155
|
+
|
156
|
+
transform: translateY(100%) scaleY(2);
|
157
|
+
transition: mdc-textfield-transition(transform);
|
158
|
+
}
|
159
|
+
|
160
|
+
@mixin mdc-textfield-label-styles {
|
161
|
+
@include mdc-theme-prop(color, primary);
|
162
|
+
}
|
163
|
+
|
164
|
+
&.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after {
|
165
|
+
@include mdc-textfield-after-styles;
|
166
|
+
|
167
|
+
@include mdc-theme-dark(".mdc-textfield", true) {
|
168
|
+
@include mdc-textfield-after-styles;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
.mdc-textfield__label {
|
173
|
+
@include mdc-textfield-label-styles;
|
174
|
+
|
175
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
176
|
+
@include mdc-textfield-label-styles;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
.mdc-textfield--dense {
|
182
|
+
margin-top: 12px;
|
183
|
+
margin-bottom: 4px;
|
184
|
+
font-size: .813rem;
|
185
|
+
|
186
|
+
.mdc-textfield__label--float-above {
|
187
|
+
// NOTE: This is an eyeball'd approximation of what's in the mocks.
|
188
|
+
transform: translateY(calc(-100% - 2px)) scale(.923, .923);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
.mdc-textfield--invalid {
|
193
|
+
&:not(.mdc-textfield--focused) {
|
194
|
+
&::after {
|
195
|
+
background-color: $mdc-textfield-error-on-light;
|
196
|
+
}
|
197
|
+
|
198
|
+
.mdc-textfield__label {
|
199
|
+
color: $mdc-textfield-error-on-light;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
@include mdc-theme-dark(".mdc-textfield", true) {
|
204
|
+
&:not(.mdc-textfield--focused) {
|
205
|
+
&::after {
|
206
|
+
background-color: $mdc-textfield-error-on-dark;
|
207
|
+
}
|
208
|
+
|
209
|
+
.mdc-textfield__label {
|
210
|
+
color: $mdc-textfield-error-on-dark;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
.mdc-textfield--disabled {
|
217
|
+
&::after {
|
218
|
+
display: none;
|
219
|
+
}
|
220
|
+
|
221
|
+
// Account for offset by border
|
222
|
+
.mdc-textfield__input {
|
223
|
+
padding-bottom: 7px;
|
224
|
+
}
|
225
|
+
|
226
|
+
border-bottom: 1px dotted $mdc-textfield-disabled-border-on-light;
|
227
|
+
|
228
|
+
@include mdc-theme-dark(".mdc-textfield", true) {
|
229
|
+
border-bottom: 1px dotted $mdc-textfield-disabled-border-on-dark;
|
230
|
+
}
|
231
|
+
|
232
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
233
|
+
.mdc-textfield__input,
|
234
|
+
.mdc-textfield__label,
|
235
|
+
& + .mdc-textfield-helptext {
|
236
|
+
@include mdc-theme-prop(color, text-disabled-on-light);
|
237
|
+
}
|
238
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
239
|
+
|
240
|
+
.mdc-textfield__input,
|
241
|
+
.mdc-textfield__label {
|
242
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
243
|
+
@include mdc-theme-prop(color, text-disabled-on-dark);
|
244
|
+
}
|
245
|
+
}
|
246
|
+
|
247
|
+
@include mdc-theme-dark(".mdc-textfield", true) {
|
248
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
249
|
+
+ .mdc-textfield-helptext {
|
250
|
+
@include mdc-theme-prop(colr, text-disabled-on-dark);
|
251
|
+
}
|
252
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
253
|
+
}
|
254
|
+
|
255
|
+
.mdc-textfield__label {
|
256
|
+
bottom: 7px;
|
257
|
+
cursor: default;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
.mdc-textfield__input:required + .mdc-textfield__label::after {
|
262
|
+
margin-left: 1px;
|
263
|
+
content: "*";
|
264
|
+
|
265
|
+
.mdc-textfield--focused & {
|
266
|
+
color: $mdc-textfield-error-on-light;
|
267
|
+
}
|
268
|
+
|
269
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
270
|
+
.mdc-textfield--focused & {
|
271
|
+
color: $mdc-textfield-error-on-dark;
|
272
|
+
}
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
.mdc-textfield--multiline {
|
277
|
+
/* stylelint-disable scss/dollar-variable-pattern */
|
278
|
+
$padding-inset: 4px;
|
279
|
+
$label-offset-y: $padding-inset + 2;
|
280
|
+
$label-offset-x: $padding-inset;
|
281
|
+
/* stylelint-enable scss/dollar-variable-pattern */
|
282
|
+
|
283
|
+
display: flex;
|
284
|
+
height: initial;
|
285
|
+
transition: none;
|
286
|
+
|
287
|
+
&::after {
|
288
|
+
content: initial;
|
289
|
+
}
|
290
|
+
|
291
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
292
|
+
|
293
|
+
.mdc-textfield__input {
|
294
|
+
padding: $padding-inset;
|
295
|
+
transition: mdc-textfield-transition(border-color);
|
296
|
+
border: 1px solid $mdc-textfield-divider-on-light;
|
297
|
+
border-radius: 2px;
|
298
|
+
|
299
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
300
|
+
border-color: $mdc-textfield-divider-on-dark;
|
301
|
+
}
|
302
|
+
|
303
|
+
&:focus {
|
304
|
+
@include mdc-theme-prop(border-color, primary);
|
305
|
+
}
|
306
|
+
|
307
|
+
&:invalid:not(:focus) {
|
308
|
+
border-color: $mdc-textfield-error-on-light;
|
309
|
+
}
|
310
|
+
|
311
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
312
|
+
&:invalid:not(:focus) {
|
313
|
+
border-color: $mdc-textfield-error-on-dark;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
}
|
317
|
+
|
318
|
+
.mdc-textfield__label {
|
319
|
+
top: $label-offset-y;
|
320
|
+
bottom: initial;
|
321
|
+
left: $label-offset-x;
|
322
|
+
|
323
|
+
@include mdc-rtl(".mdc-textfield--multiline") {
|
324
|
+
right: $label-offset-x;
|
325
|
+
left: auto;
|
326
|
+
}
|
327
|
+
|
328
|
+
&--float-above {
|
329
|
+
// Translate above the top of the input, and compensate for the amount of offset needed
|
330
|
+
// to position the label within the bounds of the inset padding.
|
331
|
+
// Note that the scale factor is an eyeball'd approximation of what's shown in the mocks.
|
332
|
+
transform: translateY(calc(-100% - #{$label-offset-y})) scale(.923, .923);
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
&.mdc-textfield--disabled {
|
337
|
+
border-bottom: none;
|
338
|
+
|
339
|
+
.mdc-textfield__input {
|
340
|
+
border: 1px dotted $mdc-textfield-disabled-border-on-light;
|
341
|
+
|
342
|
+
@include mdc-theme-dark(".mdc-textfield") {
|
343
|
+
border-color: $mdc-textfield-disabled-border-on-dark;
|
344
|
+
}
|
345
|
+
}
|
346
|
+
}
|
347
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
348
|
+
}
|
349
|
+
|
350
|
+
.mdc-textfield--fullwidth {
|
351
|
+
display: block;
|
352
|
+
width: 100%;
|
353
|
+
box-sizing: border-box;
|
354
|
+
margin: 0;
|
355
|
+
border: none;
|
356
|
+
border-bottom: 1px solid $mdc-textfield-divider-on-light;
|
357
|
+
outline: none;
|
358
|
+
|
359
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
360
|
+
|
361
|
+
&:not(.mdc-textfield--multiline) {
|
362
|
+
height: 56px;
|
363
|
+
}
|
364
|
+
|
365
|
+
&.mdc-textfield--multiline {
|
366
|
+
padding: 20px 0 0;
|
367
|
+
}
|
368
|
+
|
369
|
+
&.mdc-textfield--dense {
|
370
|
+
&:not(.mdc-textfield--multiline) {
|
371
|
+
height: 48px;
|
372
|
+
}
|
373
|
+
|
374
|
+
&.mdc-textfield--multiline {
|
375
|
+
padding: 16px 0 0;
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
&.mdc-textfield--disabled {
|
380
|
+
&,
|
381
|
+
&.mdc-textfield--multiline {
|
382
|
+
border-bottom: 1px dotted $mdc-textfield-divider-on-light;
|
383
|
+
}
|
384
|
+
}
|
385
|
+
|
386
|
+
@include mdc-theme-dark {
|
387
|
+
border-bottom: 1px solid $mdc-textfield-divider-on-dark;
|
388
|
+
|
389
|
+
&.mdc-textfield--disabled {
|
390
|
+
&,
|
391
|
+
&.mdc-textfield--multiline {
|
392
|
+
border-bottom: 1px dotted $mdc-textfield-divider-on-dark;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
398
|
+
|
399
|
+
.mdc-textfield__input {
|
400
|
+
width: 100%;
|
401
|
+
height: 100%;
|
402
|
+
padding: 0;
|
403
|
+
resize: none;
|
404
|
+
// Use !important here to override all other border treatments
|
405
|
+
border: none !important;
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
// Graceful degredation for css-only inputs
|
410
|
+
|
411
|
+
.mdc-textfield {
|
412
|
+
&:not(.mdc-textfield--upgraded):not(.mdc-textfield--multiline) .mdc-textfield__input {
|
413
|
+
transition: mdc-textfield-transition(border-bottom-color);
|
414
|
+
border-bottom: 1px solid $mdc-textfield-divider-on-light;
|
415
|
+
}
|
416
|
+
|
417
|
+
&:not(.mdc-textfield--upgraded) .mdc-textfield__input {
|
418
|
+
&:focus {
|
419
|
+
@include mdc-theme-prop(border-color, primary);
|
420
|
+
}
|
421
|
+
|
422
|
+
&:disabled {
|
423
|
+
@include mdc-theme-prop(color, text-disabled-on-light);
|
424
|
+
|
425
|
+
border-style: dotted;
|
426
|
+
border-color: $mdc-textfield-disabled-border-on-light;
|
427
|
+
}
|
428
|
+
|
429
|
+
&:invalid:not(:focus) {
|
430
|
+
border-color: $mdc-textfield-error-on-light;
|
431
|
+
}
|
432
|
+
}
|
433
|
+
|
434
|
+
@include mdc-theme-dark {
|
435
|
+
&:not(.mdc-textfield--upgraded) .mdc-textfield__input {
|
436
|
+
&:not(:focus) {
|
437
|
+
border-color: rgba(white, .12);
|
438
|
+
}
|
439
|
+
|
440
|
+
&:disabled {
|
441
|
+
@include mdc-theme-prop(color, text-disabled-on-dark);
|
442
|
+
|
443
|
+
border-color: $mdc-textfield-disabled-border-on-dark;
|
444
|
+
}
|
445
|
+
|
446
|
+
&:invalid:not(:focus) {
|
447
|
+
border-color: $mdc-textfield-error-on-dark;
|
448
|
+
}
|
449
|
+
}
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
/* postcss-bem-linter: end */
|
454
|
+
|
455
|
+
/* postcss-bem-linter: define textfield-helptext */
|
456
|
+
|
457
|
+
.mdc-textfield-helptext {
|
458
|
+
@include mdc-theme-prop(color, text-hint-on-light);
|
459
|
+
|
460
|
+
margin: 0;
|
461
|
+
transition: mdc-textfield-transition(opacity);
|
462
|
+
font-size: .75rem;
|
463
|
+
opacity: 0;
|
464
|
+
will-change: opacity;
|
465
|
+
|
466
|
+
@include mdc-theme-dark {
|
467
|
+
@include mdc-theme-prop(color, text-hint-on-dark);
|
468
|
+
}
|
469
|
+
|
470
|
+
/* stylelint-disable plugin/selector-bem-pattern */
|
471
|
+
.mdc-textfield + & {
|
472
|
+
margin-bottom: 8px;
|
473
|
+
}
|
474
|
+
|
475
|
+
.mdc-textfield--dense + & {
|
476
|
+
margin-bottom: 4px;
|
477
|
+
}
|
478
|
+
|
479
|
+
.mdc-textfield--focused + &:not(#{&}--validation-msg) {
|
480
|
+
opacity: 1;
|
481
|
+
}
|
482
|
+
|
483
|
+
/* stylelint-enable plugin/selector-bem-pattern */
|
484
|
+
}
|
485
|
+
|
486
|
+
.mdc-textfield-helptext--persistent {
|
487
|
+
transition: none;
|
488
|
+
opacity: 1;
|
489
|
+
will-change: initial;
|
490
|
+
}
|
491
|
+
|
492
|
+
/* postcss-bem-linter: end */
|
493
|
+
|
494
|
+
.mdc-textfield--invalid {
|
495
|
+
+ .mdc-textfield-helptext--validation-msg {
|
496
|
+
color: $mdc-textfield-error-on-light;
|
497
|
+
opacity: 1;
|
498
|
+
}
|
499
|
+
|
500
|
+
@include mdc-theme-dark(".mdc-textfield", true) {
|
501
|
+
+ .mdc-textfield-helptext--validation-msg {
|
502
|
+
color: $mdc-textfield-error-on-dark;
|
503
|
+
}
|
504
|
+
}
|
505
|
+
}
|
506
|
+
|
507
|
+
// mdc-form-field tweaks to align text field label correctly
|
508
|
+
/* stylelint-disable selector-no-type */
|
509
|
+
.mdc-form-field > .mdc-textfield + label {
|
510
|
+
align-self: flex-start;
|
511
|
+
}
|
512
|
+
/* stylelint-enable selector-no-type */
|