material_components_web-sass 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +7 -0
  5. data/CHANGELOG.md +8 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +97 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/material_components_web-sass.rb +52 -0
  13. data/lib/material_components_web/sass/engine.rb +18 -0
  14. data/lib/material_components_web/sass/version.rb +5 -0
  15. data/material_components_web-sass.gemspec +32 -0
  16. data/vendor/assets/fonts/material-icons/LICENSE +202 -0
  17. data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.eot +0 -0
  18. data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.ttf +0 -0
  19. data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff +0 -0
  20. data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff2 +0 -0
  21. data/vendor/assets/fonts/roboto/LICENSE.txt +202 -0
  22. data/vendor/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
  23. data/vendor/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  24. data/vendor/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  25. data/vendor/assets/fonts/roboto/Roboto-Light.ttf +0 -0
  26. data/vendor/assets/fonts/roboto/Roboto-Light.woff +0 -0
  27. data/vendor/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  28. data/vendor/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
  29. data/vendor/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  30. data/vendor/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  31. data/vendor/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
  32. data/vendor/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  33. data/vendor/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  34. data/vendor/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
  35. data/vendor/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  36. data/vendor/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  37. data/vendor/assets/javascripts/material-components-web.js +5492 -0
  38. data/vendor/assets/stylesheets/@material/animation/_functions.scss +25 -0
  39. data/vendor/assets/stylesheets/@material/animation/_mixins.scss +29 -0
  40. data/vendor/assets/stylesheets/@material/animation/_variables.scss +19 -0
  41. data/vendor/assets/stylesheets/@material/animation/mdc-animation.scss +31 -0
  42. data/vendor/assets/stylesheets/@material/button/mdc-button.scss +199 -0
  43. data/vendor/assets/stylesheets/@material/card/mdc-card.scss +179 -0
  44. data/vendor/assets/stylesheets/@material/checkbox/_keyframes.scss +180 -0
  45. data/vendor/assets/stylesheets/@material/checkbox/_variables.scss +31 -0
  46. data/vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss +310 -0
  47. data/vendor/assets/stylesheets/@material/drawer/_mixins.scss +145 -0
  48. data/vendor/assets/stylesheets/@material/drawer/mdc-drawer.scss +18 -0
  49. data/vendor/assets/stylesheets/@material/drawer/permanent/mdc-permanent-drawer.scss +54 -0
  50. data/vendor/assets/stylesheets/@material/drawer/temporary/mdc-temporary-drawer.scss +134 -0
  51. data/vendor/assets/stylesheets/@material/elevation/_mixins.scss +68 -0
  52. data/vendor/assets/stylesheets/@material/elevation/_variables.scss +122 -0
  53. data/vendor/assets/stylesheets/@material/elevation/mdc-elevation.scss +27 -0
  54. data/vendor/assets/stylesheets/@material/fab/mdc-fab.scss +122 -0
  55. data/vendor/assets/stylesheets/@material/fonts/material-icons.scss +36 -0
  56. data/vendor/assets/stylesheets/@material/fonts/roboto.scss +45 -0
  57. data/vendor/assets/stylesheets/@material/form-field/mdc-form-field.scss +64 -0
  58. data/vendor/assets/stylesheets/@material/icon-toggle/mdc-icon-toggle.scss +133 -0
  59. data/vendor/assets/stylesheets/@material/list/mdc-list.scss +207 -0
  60. data/vendor/assets/stylesheets/@material/menu/mdc-menu.scss +22 -0
  61. data/vendor/assets/stylesheets/@material/menu/simple/mdc-simple-menu.scss +194 -0
  62. data/vendor/assets/stylesheets/@material/radio/mdc-radio.scss +198 -0
  63. data/vendor/assets/stylesheets/@material/ripple/_keyframes.scss +61 -0
  64. data/vendor/assets/stylesheets/@material/ripple/_mixins.scss +196 -0
  65. data/vendor/assets/stylesheets/@material/ripple/_variables.scss +17 -0
  66. data/vendor/assets/stylesheets/@material/ripple/mdc-ripple.scss +80 -0
  67. data/vendor/assets/stylesheets/@material/rtl/_mixins.scss +251 -0
  68. data/vendor/assets/stylesheets/@material/select/mdc-select.scss +174 -0
  69. data/vendor/assets/stylesheets/@material/snackbar/_variables.scss +22 -0
  70. data/vendor/assets/stylesheets/@material/snackbar/mdc-snackbar.scss +126 -0
  71. data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +512 -0
  72. data/vendor/assets/stylesheets/@material/theme/_constants.scss +285 -0
  73. data/vendor/assets/stylesheets/@material/theme/_functions.scss +64 -0
  74. data/vendor/assets/stylesheets/@material/theme/_mixins.scss +104 -0
  75. data/vendor/assets/stylesheets/@material/theme/_variables.scss +80 -0
  76. data/vendor/assets/stylesheets/@material/theme/mdc-theme.scss +43 -0
  77. data/vendor/assets/stylesheets/@material/typography/_mixins.scss +45 -0
  78. data/vendor/assets/stylesheets/@material/typography/_variables.scss +109 -0
  79. data/vendor/assets/stylesheets/@material/typography/mdc-typography.scss +32 -0
  80. data/vendor/assets/stylesheets/_material-components-web.scss +36 -0
  81. metadata +195 -0
@@ -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
+ @import "./simple/mdc-simple-menu";
18
+
19
+ .mdc-menu-anchor {
20
+ position: relative;
21
+ overflow: visible;
22
+ }
@@ -0,0 +1,194 @@
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/elevation/mixins";
19
+ @import "@material/theme/mixins";
20
+ @import "@material/typography/mixins";
21
+
22
+ $mdc-simple-menu-fade-duration: .2s;
23
+ $mdc-simple-menu-item-fade-duration: .3s;
24
+
25
+ /* postcss-bem-linter: define simple-menu */
26
+ .mdc-simple-menu {
27
+ display: none;
28
+ position: absolute;
29
+ max-width: calc(100vw - 32px);
30
+ max-height: calc(100vh - 32px);
31
+ margin: 0;
32
+ padding: 0;
33
+ transform: scale(0);
34
+ transform-origin: top left;
35
+ border-radius: 2px;
36
+ background-color: white;
37
+ white-space: nowrap;
38
+ opacity: 0;
39
+ overflow: hidden;
40
+ box-sizing: border-box;
41
+ will-change: transform, opacity;
42
+
43
+ @include mdc-elevation(2);
44
+
45
+ @include mdc-theme-dark {
46
+ background-color: #424242;
47
+ }
48
+
49
+ &:focus {
50
+ outline: none;
51
+ }
52
+
53
+ &--open {
54
+ display: inline-block;
55
+ transform: scale(1);
56
+ opacity: 1;
57
+ }
58
+
59
+ &--animating {
60
+ display: inline-block;
61
+ transition: opacity $mdc-simple-menu-fade-duration $mdc-animation-linear-out-slow-in-timing-function;
62
+ }
63
+
64
+ &__items {
65
+ display: inline-block;
66
+ overflow-x: hidden;
67
+ overflow-y: auto;
68
+ box-sizing: border-box;
69
+ will-change: transform;
70
+
71
+ /* stylelint-disable plugin/selector-bem-pattern, selector-no-universal */
72
+ > * {
73
+ opacity: 0;
74
+ }
75
+
76
+ > .mdc-list-item {
77
+ cursor: pointer;
78
+ }
79
+
80
+ .mdc-simple-menu--animating & {
81
+ overflow-y: hidden;
82
+ > * {
83
+ transition-duration: $mdc-simple-menu-item-fade-duration;
84
+ transition-property: opacity;
85
+ transition-timing-function: $mdc-animation-linear-out-slow-in-timing-function;
86
+ }
87
+ }
88
+
89
+ .mdc-simple-menu--open & {
90
+ > * {
91
+ opacity: 1;
92
+ will-change: opacity;
93
+ }
94
+ }
95
+ /* stylelint-enable plugin/selector-bem-pattern, selector-no-universal */
96
+ }
97
+
98
+ /* stylelint-disable plugin/selector-bem-pattern */
99
+ [dir="rtl"] & {
100
+ transform-origin: top right;
101
+ }
102
+ /* stylelint-enable plugin/selector-bem-pattern */
103
+
104
+ // Note: it's appropriate to use `!important` for these since:
105
+ // - they override defaults at several levels of specificity;
106
+ // - they're optional classes that are purposely added by the developer to obtain a desired behaviour.
107
+ &--open-from-top-left {
108
+ transform-origin: top left !important;
109
+ }
110
+
111
+ &--open-from-top-right {
112
+ transform-origin: top right !important;
113
+ }
114
+
115
+ &--open-from-bottom-left {
116
+ transform-origin: bottom left !important;
117
+ }
118
+
119
+ &--open-from-bottom-right {
120
+ transform-origin: bottom right !important;
121
+ }
122
+
123
+ /* stylelint-disable plugin/selector-bem-pattern */
124
+ .mdc-list-group,
125
+ .mdc-list {
126
+ padding: 0;
127
+ }
128
+
129
+ .mdc-list-item {
130
+ position: relative;
131
+ padding: 0 16px;
132
+ outline: none;
133
+ color: inherit;
134
+ text-decoration: none;
135
+
136
+ @include mdc-typography(body2);
137
+
138
+ @include mdc-theme-dark(".mdc-simple-menu", true) {
139
+ color: white;
140
+ }
141
+ }
142
+
143
+ .mdc-list-divider {
144
+ @include mdc-theme-dark(".mdc-simple-menu", true) {
145
+ border-color: rgba(white, .12);
146
+ }
147
+ }
148
+
149
+ .mdc-list-item__start-detail {
150
+ color: rgba(black, .54);
151
+
152
+ @include mdc-theme-dark(".mdc-simple-menu", true) {
153
+ color: rgba(white, .54);
154
+ }
155
+ }
156
+
157
+ /* stylelint-disable selector-no-qualifying-type */
158
+ &--selected.mdc-list-item,
159
+ &--selected.mdc-list-item .mdc-list-item__start-detail {
160
+ @include mdc-theme-prop(color, primary);
161
+ }
162
+ /* stylelint-enable selector-no-qualifying-type */
163
+
164
+ /* TODO(sgomes): Revisit when we have interactive lists. */
165
+ .mdc-list-item::before {
166
+ position: absolute;
167
+ top: 0;
168
+ left: 0;
169
+ width: 100%;
170
+ height: 100%;
171
+ transition: opacity 120ms $mdc-animation-linear-out-slow-in-timing-function;
172
+ border-radius: inherit;
173
+ background: currentColor;
174
+ content: "";
175
+ opacity: 0;
176
+ }
177
+
178
+ .mdc-list-item:focus::before {
179
+ opacity: .12;
180
+ }
181
+
182
+ .mdc-list-item:active::before {
183
+ /*
184
+ Slightly darker value for visual distinction.
185
+ This allows a full base that has distinct modes.
186
+ Progressive enhancement with ripples will provide complete button spec alignment.
187
+ */
188
+ opacity: .18;
189
+ }
190
+
191
+ /* stylelint-enable plugin/selector-bem-pattern */
192
+ }
193
+
194
+ /* postcss-bem-linter: end */
@@ -0,0 +1,198 @@
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/ripple/mixins";
19
+ @import "@material/theme/mixins";
20
+
21
+ $mdc-radio-touch-area: 40px;
22
+ $mdc-radio-ui-size: 20px;
23
+ $mdc-radio-ui-pct: percentage($mdc-radio-ui-size / $mdc-radio-touch-area);
24
+ $mdc-radio-transition-duration: 120ms;
25
+
26
+ @function mdc-radio-enter($name) {
27
+ @return mdc-animation-enter($name, $mdc-radio-transition-duration);
28
+ }
29
+
30
+ @function mdc-radio-exit($name) {
31
+ @return mdc-animation-exit($name, $mdc-radio-transition-duration);
32
+ }
33
+
34
+ /* postcss-bem-linter: define radio */
35
+ .mdc-radio {
36
+ display: inline-block;
37
+ position: relative;
38
+ box-sizing: border-box;
39
+ width: $mdc-radio-touch-area;
40
+ height: $mdc-radio-touch-area;
41
+ padding: ($mdc-radio-touch-area - $mdc-radio-ui-size) / 2;
42
+ cursor: pointer;
43
+ will-change: opacity, transform, border-color, background-color, color;
44
+
45
+ // Container for radio circles and ripple.
46
+ &__background {
47
+ display: inline-block;
48
+ position: absolute;
49
+ width: $mdc-radio-ui-pct;
50
+ height: $mdc-radio-ui-pct;
51
+ box-sizing: border-box;
52
+
53
+ &::before {
54
+ @include mdc-theme-prop(background-color, primary);
55
+
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 100%;
60
+ height: 100%;
61
+ transform: scale(0, 0);
62
+ transition: mdc-radio-exit(opacity), mdc-radio-exit(transform);
63
+ border-radius: 50%;
64
+ content: "";
65
+ opacity: 0;
66
+ pointer-events: none;
67
+ }
68
+ }
69
+
70
+ &__outer-circle {
71
+ @include mdc-theme-prop(border-color, text-secondary-on-light);
72
+
73
+ @include mdc-theme-dark(".mdc-radio") {
74
+ @include mdc-theme-prop(border-color, text-secondary-on-dark);
75
+ }
76
+
77
+ position: absolute;
78
+ top: 0;
79
+ left: 0;
80
+ width: 100%;
81
+ height: 100%;
82
+ transition: mdc-radio-exit(border-color);
83
+ border-width: 2px;
84
+ border-style: solid;
85
+ border-radius: 50%;
86
+ box-sizing: border-box;
87
+ }
88
+
89
+ &__inner-circle {
90
+ @include mdc-theme-prop(background-color, text-secondary-on-light);
91
+
92
+ @include mdc-theme-dark(".mdc-radio") {
93
+ @include mdc-theme-prop(background-color, text-secondary-on-dark);
94
+ }
95
+
96
+ position: absolute;
97
+ top: 0;
98
+ left: 0;
99
+ width: 100%;
100
+ height: 100%;
101
+ transform: scale(0, 0);
102
+ transition: mdc-radio-exit(transform), mdc-radio-exit(background-color);
103
+ border-radius: 50%;
104
+ box-sizing: border-box;
105
+ }
106
+
107
+ &__native-control {
108
+ position: absolute;
109
+ top: 0;
110
+ left: 0;
111
+ width: 100%;
112
+ height: 100%;
113
+ margin: 0;
114
+ padding: 0;
115
+ cursor: inherit;
116
+ opacity: 0;
117
+ z-index: 1;
118
+ }
119
+ }
120
+
121
+ .mdc-radio__native-control:checked,
122
+ .mdc-radio__native-control:disabled {
123
+ + .mdc-radio__background {
124
+ transition: mdc-radio-enter(opacity), mdc-radio-enter(transform);
125
+
126
+ .mdc-radio__outer-circle {
127
+ transition: mdc-radio-enter(border-color);
128
+ }
129
+
130
+ .mdc-radio__inner-circle {
131
+ transition: mdc-radio-enter(transform), mdc-radio-enter(background-color);
132
+ }
133
+ }
134
+ }
135
+
136
+ .mdc-radio--disabled {
137
+ cursor: default;
138
+ pointer-events: none;
139
+ }
140
+
141
+ .mdc-radio__native-control:checked {
142
+ + .mdc-radio__background {
143
+ .mdc-radio__outer-circle {
144
+ @include mdc-theme-prop(border-color, primary);
145
+ }
146
+
147
+ .mdc-radio__inner-circle {
148
+ @include mdc-theme-prop(background-color, primary);
149
+
150
+ transform: scale(.5);
151
+ transition: mdc-radio-enter(transform), mdc-radio-enter(background-color);
152
+ }
153
+ }
154
+ }
155
+
156
+ .mdc-radio__native-control:disabled,
157
+ fieldset:disabled .mdc-radio__native-control,
158
+ [aria-disabled="true"] .mdc-radio__native-control {
159
+ + .mdc-radio__background {
160
+ cursor: default;
161
+
162
+ .mdc-radio__outer-circle {
163
+ border-color: rgba(black, .26);
164
+
165
+ @include mdc-theme-dark(".mdc-radio") {
166
+ border-color: rgba(white, .3);
167
+ }
168
+ }
169
+
170
+ .mdc-radio__inner-circle {
171
+ background-color: rgba(black, .26);
172
+
173
+ @include mdc-theme-dark(".mdc-radio") {
174
+ background-color: rgba(white, .3);
175
+ }
176
+ }
177
+ }
178
+ }
179
+
180
+ .mdc-radio__native-control:focus {
181
+ + .mdc-radio__background::before {
182
+ transform: scale(2.8, 2.8);
183
+ transition: mdc-radio-enter(opacity), mdc-radio-enter(transform);
184
+ opacity: .26;
185
+ }
186
+ }
187
+
188
+ /* postcss-bem-linter: end */
189
+
190
+ .mdc-radio.mdc-ripple-upgraded {
191
+ @include mdc-ripple-base;
192
+ @include mdc-ripple-bg((pseudo: "::before", theme-style: primary, opacity: .14));
193
+ @include mdc-ripple-fg((pseudo: "::after", theme-style: primary, opacity: .14));
194
+
195
+ .mdc-radio__background::before {
196
+ content: none;
197
+ }
198
+ }
@@ -0,0 +1,61 @@
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
+ /** MDC Ripple keyframes are split into their own file so that _mixins.scss can rely on them. */
18
+
19
+ @import "./variables";
20
+
21
+ @keyframes mdc-ripple-fg-radius-in {
22
+ from {
23
+ transform: scale(0);
24
+ animation-timing-function: $mdc-ripple-easing-fn;
25
+ }
26
+
27
+ to {
28
+ transform: scale(1.5);
29
+ }
30
+ }
31
+
32
+ @keyframes mdc-ripple-fg-opacity-out {
33
+ from {
34
+ opacity: 1;
35
+ animation-timing-function: linear;
36
+ }
37
+
38
+ to {
39
+ opacity: 0;
40
+ }
41
+ }
42
+
43
+ @keyframes mdc-ripple-fg-unbounded-opacity-deactivate {
44
+ from {
45
+ opacity: 1;
46
+ }
47
+
48
+ to {
49
+ opacity: 0;
50
+ }
51
+ }
52
+
53
+ @keyframes mdc-ripple-fg-unbounded-transform-deactivate {
54
+ from {
55
+ transform: var(--mdc-ripple-fg-approx-xf);
56
+ }
57
+
58
+ to {
59
+ transform: scale(1.01);
60
+ }
61
+ }