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,145 @@
|
|
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/animation/variables";
|
19
|
+
@import "@material/theme/mixins";
|
20
|
+
@import "@material/typography/mixins";
|
21
|
+
|
22
|
+
/* All variables are local, so disable pattern checking. */
|
23
|
+
/* stylelint-disable scss/dollar-variable-pattern */
|
24
|
+
|
25
|
+
@mixin mdc-drawer-toolbar-spacer_() {
|
26
|
+
&__toolbar-spacer {
|
27
|
+
display: flex;
|
28
|
+
position: relative;
|
29
|
+
flex-direction: row;
|
30
|
+
flex-shrink: 0;
|
31
|
+
align-items: flex-center;
|
32
|
+
height: 56px;
|
33
|
+
padding: 16px;
|
34
|
+
border-bottom: 1px solid rgba(0, 0, 0, .12);
|
35
|
+
box-sizing: border-box;
|
36
|
+
|
37
|
+
@include mdc-theme-dark(quote(#{&})) {
|
38
|
+
border-bottom: 1px solid rgba(255, 255, 255, .12);
|
39
|
+
}
|
40
|
+
|
41
|
+
/* TODO(sgomes): replace with global breakpoints when we have them */
|
42
|
+
@media (min-width: 600px) {
|
43
|
+
height: 64px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
@mixin mdc-drawer-header_() {
|
49
|
+
/* Use aspect ratio trick to maintain 16:9 aspect ratio on the header */
|
50
|
+
&__header {
|
51
|
+
position: relative;
|
52
|
+
}
|
53
|
+
|
54
|
+
&__header::before {
|
55
|
+
display: block;
|
56
|
+
padding-top: 9 / 16 * 100%;
|
57
|
+
content: "";
|
58
|
+
}
|
59
|
+
|
60
|
+
&__header-content {
|
61
|
+
display: flex;
|
62
|
+
position: absolute;
|
63
|
+
top: 0;
|
64
|
+
right: 0;
|
65
|
+
bottom: 0;
|
66
|
+
left: 0;
|
67
|
+
align-items: flex-end;
|
68
|
+
padding: 16px;
|
69
|
+
box-sizing: border-box;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
@mixin mdc-drawer-list_() {
|
74
|
+
.mdc-list-group,
|
75
|
+
.mdc-list {
|
76
|
+
padding-right: 0;
|
77
|
+
padding-left: 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
.mdc-list-item {
|
81
|
+
position: relative;
|
82
|
+
padding: 0 16px;
|
83
|
+
outline: none;
|
84
|
+
color: inherit;
|
85
|
+
text-decoration: none;
|
86
|
+
|
87
|
+
@include mdc-typography(body2);
|
88
|
+
}
|
89
|
+
|
90
|
+
.mdc-list-item__start-detail {
|
91
|
+
color: rgba(0, 0, 0, .54);
|
92
|
+
|
93
|
+
@include mdc-theme-dark(#{&}) {
|
94
|
+
color: rgba(255, 255, 255, .54);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
/* stylelint-disable selector-no-qualifying-type */
|
99
|
+
&--selected.mdc-list-item,
|
100
|
+
&--selected.mdc-list-item .mdc-list-item__start-detail {
|
101
|
+
@include mdc-theme-prop(color, primary);
|
102
|
+
}
|
103
|
+
/* stylelint-enable selector-no-qualifying-type */
|
104
|
+
|
105
|
+
/* TODO(sgomes): Revisit when we have interactive lists. */
|
106
|
+
.mdc-list-item::before {
|
107
|
+
position: absolute;
|
108
|
+
top: 0;
|
109
|
+
left: 0;
|
110
|
+
width: 100%;
|
111
|
+
height: 100%;
|
112
|
+
transition: mdc-animation-exit(opacity, 120ms);
|
113
|
+
border-radius: inherit;
|
114
|
+
background: currentColor;
|
115
|
+
content: "";
|
116
|
+
opacity: 0;
|
117
|
+
}
|
118
|
+
|
119
|
+
.mdc-list-item:focus::before {
|
120
|
+
transition: mdc-animation-enter(opacity, 180ms);
|
121
|
+
opacity: .12;
|
122
|
+
}
|
123
|
+
|
124
|
+
.mdc-list-item:active::before {
|
125
|
+
/*
|
126
|
+
Slightly darker value for visual distinction.
|
127
|
+
This allows a full base that has distinct modes.
|
128
|
+
Progressive enhancement with ripples will provide complete button spec alignment.
|
129
|
+
*/
|
130
|
+
transition: mdc-animation-enter(opacity, 180ms);
|
131
|
+
opacity: .18;
|
132
|
+
}
|
133
|
+
|
134
|
+
.mdc-list-item:active:focus::before {
|
135
|
+
transition-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
@mixin mdc-drawer-base_() {
|
140
|
+
@include mdc-drawer-toolbar-spacer_;
|
141
|
+
@include mdc-drawer-header_;
|
142
|
+
@include mdc-drawer-list_;
|
143
|
+
}
|
144
|
+
|
145
|
+
/* stylelint-enable scss/dollar-variable-pattern */
|
@@ -0,0 +1,18 @@
|
|
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 "./permanent/mdc-permanent-drawer";
|
18
|
+
@import "./temporary/mdc-temporary-drawer";
|
@@ -0,0 +1,54 @@
|
|
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/rtl/mixins";
|
18
|
+
@import "@material/theme/mixins";
|
19
|
+
@import "../mixins";
|
20
|
+
|
21
|
+
$mdc-permanent-drawer-width: 240px;
|
22
|
+
|
23
|
+
.mdc-permanent-drawer {
|
24
|
+
@include mdc-drawer-base_;
|
25
|
+
@include mdc-theme-prop(background, background);
|
26
|
+
@include mdc-rtl-reflexive-box(border, right, 1px solid #e4e4e4);
|
27
|
+
@include mdc-rtl-reflexive-position(left, 0);
|
28
|
+
|
29
|
+
@include mdc-theme-dark {
|
30
|
+
background: #212121;
|
31
|
+
|
32
|
+
@include mdc-theme-prop(color, text-primary-on-dark);
|
33
|
+
@include mdc-rtl-reflexive-box(border, right, 1px solid rgba(white, .12));
|
34
|
+
}
|
35
|
+
|
36
|
+
display: inline-flex;
|
37
|
+
flex-direction: column;
|
38
|
+
width: $mdc-permanent-drawer-width;
|
39
|
+
height: 100%;
|
40
|
+
box-sizing: border-box;
|
41
|
+
overflow: hidden;
|
42
|
+
|
43
|
+
&--floating {
|
44
|
+
background: none;
|
45
|
+
|
46
|
+
@include mdc-rtl-reflexive-box(border, right, none);
|
47
|
+
|
48
|
+
@include mdc-theme-dark {
|
49
|
+
background: none;
|
50
|
+
|
51
|
+
@include mdc-rtl-reflexive-box(border, right, none);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
@@ -0,0 +1,134 @@
|
|
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/elevation/mixins";
|
19
|
+
@import "@material/rtl/mixins";
|
20
|
+
@import "@material/theme/mixins";
|
21
|
+
@import "../mixins";
|
22
|
+
|
23
|
+
.mdc-temporary-drawer {
|
24
|
+
@include mdc-drawer-base_;
|
25
|
+
|
26
|
+
position: fixed;
|
27
|
+
top: 0;
|
28
|
+
left: 0;
|
29
|
+
width: 100%;
|
30
|
+
height: 100%;
|
31
|
+
overflow: hidden;
|
32
|
+
pointer-events: none;
|
33
|
+
box-sizing: border-box;
|
34
|
+
contain: strict;
|
35
|
+
|
36
|
+
/* Shaded background */
|
37
|
+
&::before {
|
38
|
+
display: block;
|
39
|
+
position: absolute;
|
40
|
+
top: 0;
|
41
|
+
left: 0;
|
42
|
+
width: 100%;
|
43
|
+
height: 100%;
|
44
|
+
background: rgba(0, 0, 0, .6);
|
45
|
+
content: "";
|
46
|
+
opacity: 0;
|
47
|
+
opacity: var(--mdc-temporary-drawer-opacity, 0);
|
48
|
+
will-change: opacity;
|
49
|
+
box-sizing: border-box;
|
50
|
+
}
|
51
|
+
|
52
|
+
&__drawer {
|
53
|
+
@include mdc-theme-prop(background, background);
|
54
|
+
@include mdc-elevation(16);
|
55
|
+
@include mdc-rtl-reflexive-position(left, 0);
|
56
|
+
|
57
|
+
@include mdc-theme-dark(".mdc-temporary-drawer") {
|
58
|
+
background: #303030;
|
59
|
+
|
60
|
+
@include mdc-theme-prop(color, text-primary-on-dark);
|
61
|
+
}
|
62
|
+
|
63
|
+
display: flex;
|
64
|
+
position: absolute;
|
65
|
+
flex-direction: column;
|
66
|
+
width: calc(100% - 56px);
|
67
|
+
max-width: 280px;
|
68
|
+
height: 100%;
|
69
|
+
transform: translateX(calc(-100% - 20px));
|
70
|
+
will-change: transform;
|
71
|
+
box-sizing: border-box;
|
72
|
+
overflow: hidden;
|
73
|
+
touch-action: none;
|
74
|
+
|
75
|
+
@include mdc-rtl(".mdc-temporary-drawer") {
|
76
|
+
transform: translateX(calc(100% + 20px));
|
77
|
+
}
|
78
|
+
|
79
|
+
/* TODO(sgomes): replace with global breakpoints when we have them */
|
80
|
+
@media (min-width: 600px) {
|
81
|
+
width: calc(100% - 64px);
|
82
|
+
max-width: 320px;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
&__content {
|
87
|
+
flex-grow: 1;
|
88
|
+
margin: 0;
|
89
|
+
overflow-x: hidden;
|
90
|
+
overflow-y: auto;
|
91
|
+
box-sizing: border-box;
|
92
|
+
-webkit-overflow-scrolling: touch;
|
93
|
+
touch-action: pan-y;
|
94
|
+
}
|
95
|
+
|
96
|
+
&__footer {
|
97
|
+
@include mdc-elevation(2);
|
98
|
+
flex-shrink: 0;
|
99
|
+
}
|
100
|
+
|
101
|
+
&--animating {
|
102
|
+
&::before {
|
103
|
+
transition: mdc-animation-enter(opacity, .3s);
|
104
|
+
}
|
105
|
+
|
106
|
+
&.mdc-temporary-drawer--open .mdc-temporary-drawer__drawer {
|
107
|
+
transition: mdc-animation-enter(transform, .33s);
|
108
|
+
}
|
109
|
+
|
110
|
+
.mdc-temporary-drawer__drawer {
|
111
|
+
transition: mdc-animation-enter(transform, .13s);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
&--open {
|
116
|
+
pointer-events: auto;
|
117
|
+
|
118
|
+
&::before {
|
119
|
+
opacity: 1;
|
120
|
+
opacity: var(--mdc-temporary-drawer-opacity, 1);
|
121
|
+
}
|
122
|
+
|
123
|
+
.mdc-temporary-drawer__drawer {
|
124
|
+
transform: none;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Specificity fix to ensure that mdc-drawer is not translated off-screen within an RTL context
|
128
|
+
@include mdc-rtl {
|
129
|
+
.mdc-temporary-drawer__drawer {
|
130
|
+
transform: none;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
@@ -0,0 +1,68 @@
|
|
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 "./variables";
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Applies the correct css rules to an element to give it the elevation specified by $z-value.
|
21
|
+
* The $z-value must be between 0 and 24.
|
22
|
+
*/
|
23
|
+
@mixin mdc-elevation($z-value) {
|
24
|
+
@if type-of($z-value) != number or not unitless($z-value) {
|
25
|
+
@error "$z-value must be a unitless number";
|
26
|
+
}
|
27
|
+
|
28
|
+
@if $z-value < 0 or $z-value > 24 {
|
29
|
+
@error "$z-value must be between 0 and 24";
|
30
|
+
}
|
31
|
+
|
32
|
+
#{$mdc-elevation-property}:
|
33
|
+
#{map-get($mdc-elevation-umbra-map, $z-value)} $mdc-elevation-umbra-color,
|
34
|
+
// #{map-get($mdc-elevation-penumbra-map, $z-value)} $mdc-elevation-penumbra-color,
|
35
|
+
#{map-get($mdc-elevation-ambient-map, $z-value)} $mdc-elevation-ambient-color;
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Returns a string that can be used as the value for a `transition` property for elevation.
|
40
|
+
* Calling this function directly is useful in situations where a component needs to transition
|
41
|
+
* more than one property.
|
42
|
+
*
|
43
|
+
* ```scss
|
44
|
+
* .foo {
|
45
|
+
* transition: mdc-elevation-transition-rule(), opacity 100ms ease;
|
46
|
+
* will-change: $mdc-elevation-property, opacity;
|
47
|
+
* }
|
48
|
+
* ```
|
49
|
+
*/
|
50
|
+
@function mdc-elevation-transition-rule(
|
51
|
+
$duration: $mdc-elevation-transition-duration,
|
52
|
+
$easing: $mdc-elevation-transition-timing-function) {
|
53
|
+
@return #{$mdc-elevation-property} #{$duration} #{$easing};
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Applies the correct css rules needed to have an element transition between elevations.
|
58
|
+
* This mixin should be applied to elements whose elevation values will change depending on their
|
59
|
+
* context (e.g. when active or disabled).
|
60
|
+
*/
|
61
|
+
// NOTE(traviskaufman): Both this mixin and the above function use default parameters so they can
|
62
|
+
// be used in the same way by clients.
|
63
|
+
@mixin mdc-elevation-transition(
|
64
|
+
$duration: $mdc-elevation-transition-duration,
|
65
|
+
$easing: $mdc-elevation-transition-timing-function) {
|
66
|
+
transition: mdc-elevation-transition-rule($duration, $easing);
|
67
|
+
will-change: $mdc-elevation-property;
|
68
|
+
}
|
@@ -0,0 +1,122 @@
|
|
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
|
+
|
19
|
+
$mdc-elevation-umbra-color: rgba(black, .2);
|
20
|
+
$mdc-elevation-penumbra-color: rgba(black, .14);
|
21
|
+
$mdc-elevation-ambient-color: rgba(black, .12);
|
22
|
+
|
23
|
+
$mdc-elevation-umbra-map: (
|
24
|
+
0: "0px 0px 0px 0px",
|
25
|
+
1: "0px 2px 1px -1px",
|
26
|
+
2: "0px 3px 1px -2px",
|
27
|
+
3: "0px 3px 3px -2px",
|
28
|
+
4: "0px 2px 4px -1px",
|
29
|
+
5: "0px 3px 5px -1px",
|
30
|
+
6: "0px 3px 5px -1px",
|
31
|
+
7: "0px 4px 5px -2px",
|
32
|
+
8: "0px 5px 5px -3px",
|
33
|
+
9: "0px 5px 6px -3px",
|
34
|
+
10: "0px 6px 6px -3px",
|
35
|
+
11: "0px 6px 7px -4px",
|
36
|
+
12: "0px 7px 8px -4px",
|
37
|
+
13: "0px 7px 8px -4px",
|
38
|
+
14: "0px 7px 9px -4px",
|
39
|
+
15: "0px 8px 9px -5px",
|
40
|
+
16: "0px 8px 10px -5px",
|
41
|
+
17: "0px 8px 11px -5px",
|
42
|
+
18: "0px 9px 11px -5px",
|
43
|
+
19: "0px 9px 12px -6px",
|
44
|
+
20: "0px 10px 13px -6px",
|
45
|
+
21: "0px 10px 13px -6px",
|
46
|
+
22: "0px 10px 14px -6px",
|
47
|
+
23: "0px 11px 14px -7px",
|
48
|
+
24: "0px 11px 15px -7px"
|
49
|
+
);
|
50
|
+
|
51
|
+
$mdc-elevation-penumbra-map: (
|
52
|
+
0: "0px 0px 0px 0px",
|
53
|
+
1: "0px 1px 1px 0px",
|
54
|
+
2: "0px 2px 2px 0px",
|
55
|
+
3: "0px 3px 4px 0px",
|
56
|
+
4: "0px 4px 5px 0px",
|
57
|
+
5: "0px 5px 8px 0px",
|
58
|
+
6: "0px 6px 10px 0px",
|
59
|
+
7: "0px 7px 10px 1px",
|
60
|
+
8: "0px 8px 10px 1px",
|
61
|
+
9: "0px 9px 12px 1px",
|
62
|
+
10: "0px 10px 14px 1px",
|
63
|
+
11: "0px 11px 15px 1px",
|
64
|
+
12: "0px 12px 17px 2px",
|
65
|
+
13: "0px 13px 19px 2px",
|
66
|
+
14: "0px 14px 21px 2px",
|
67
|
+
15: "0px 15px 22px 2px",
|
68
|
+
16: "0px 16px 24px 2px",
|
69
|
+
17: "0px 17px 26px 2px",
|
70
|
+
18: "0px 18px 28px 2px",
|
71
|
+
19: "0px 19px 29px 2px",
|
72
|
+
20: "0px 20px 31px 3px",
|
73
|
+
21: "0px 21px 33px 3px",
|
74
|
+
22: "0px 22px 35px 3px",
|
75
|
+
23: "0px 23px 36px 3px",
|
76
|
+
24: "0px 24px 38px 3px"
|
77
|
+
);
|
78
|
+
|
79
|
+
$mdc-elevation-ambient-map: (
|
80
|
+
0: "0px 0px 0px 0px",
|
81
|
+
1: "0px 1px 3px 0px",
|
82
|
+
2: "0px 1px 5px 0px",
|
83
|
+
3: "0px 1px 8px 0px",
|
84
|
+
4: "0px 1px 10px 0px",
|
85
|
+
5: "0px 1px 14px 0px",
|
86
|
+
6: "0px 1px 18px 0px",
|
87
|
+
7: "0px 2px 16px 1px",
|
88
|
+
8: "0px 3px 14px 2px",
|
89
|
+
9: "0px 3px 16px 2px",
|
90
|
+
10: "0px 4px 18px 3px",
|
91
|
+
11: "0px 4px 20px 3px",
|
92
|
+
12: "0px 5px 22px 4px",
|
93
|
+
13: "0px 5px 24px 4px",
|
94
|
+
14: "0px 5px 26px 4px",
|
95
|
+
15: "0px 6px 28px 5px",
|
96
|
+
16: "0px 6px 30px 5px",
|
97
|
+
17: "0px 6px 32px 5px",
|
98
|
+
18: "0px 7px 34px 6px",
|
99
|
+
19: "0px 7px 36px 6px",
|
100
|
+
20: "0px 8px 38px 7px",
|
101
|
+
21: "0px 8px 40px 7px",
|
102
|
+
22: "0px 8px 42px 7px",
|
103
|
+
23: "0px 9px 44px 8px",
|
104
|
+
24: "0px 9px 46px 8px"
|
105
|
+
);
|
106
|
+
|
107
|
+
/**
|
108
|
+
* The css property used for elevation. In most cases this should not be changed. It is exposed
|
109
|
+
* as a variable for abstraction / easy use when needing to reference the property directly, for
|
110
|
+
* example in a `will-change` rule.
|
111
|
+
*/
|
112
|
+
$mdc-elevation-property: box-shadow !default;
|
113
|
+
|
114
|
+
/**
|
115
|
+
* The default duration value for elevation transitions.
|
116
|
+
*/
|
117
|
+
$mdc-elevation-transition-duration: 280ms !default;
|
118
|
+
|
119
|
+
/**
|
120
|
+
* The default easing value for elevation transitions.
|
121
|
+
*/
|
122
|
+
$mdc-elevation-transition-timing-function: $mdc-animation-fast-out-slow-in-timing-function !default;
|