Skip to content

Commit 554424a

Browse files
author
Mario Aguiar
committed
Add elevation and opacity tokens
1 parent 4d6da8c commit 554424a

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Copyright 2022 Google LLC
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+
:root {
18+
--md-sys-elevation-level5-value: 12px;
19+
--md-sys-elevation-level5-unit: 1px;
20+
--md-sys-elevation-level5: 12px;
21+
--md-sys-elevation-level4-value: 8px;
22+
--md-sys-elevation-level4-unit: 1px;
23+
--md-sys-elevation-level4: 8px;
24+
--md-sys-elevation-level3-value: 6px;
25+
--md-sys-elevation-level3-unit: 1px;
26+
--md-sys-elevation-level3: 6px;
27+
--md-sys-elevation-level2-value: 3px;
28+
--md-sys-elevation-level2-unit: 1px;
29+
--md-sys-elevation-level2: 3px;
30+
--md-sys-elevation-level1-value: 1px;
31+
--md-sys-elevation-level1-unit: 1px;
32+
--md-sys-elevation-level1: 1px;
33+
--md-sys-elevation-level0-value: 0px;
34+
--md-sys-elevation-level0-unit: 1px;
35+
--md-sys-elevation-level0: 0px;
36+
--md-sys-elevation-0: 0px 0px 0px 0px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 0px 0px 0px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 0px 0px 0px rgba(var(--md-sys-color-shadow-rgb), .12);
37+
--md-sys-elevation-1: 0px 3px 1px -2px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 2px 2px 0px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 1px 5px 0px rgba(var(--md-sys-color-shadow-rgb), .12);
38+
--md-sys-elevation-2: 0px 2px 4px -1px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 4px 5px 0px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 1px 10px 0px rgba(var(--md-sys-color-shadow-rgb), .12);
39+
--md-sys-elevation-3: 0px 5px 5px -3px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 8px 10px 1px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 3px 14px 2px rgba(var(--md-sys-color-shadow-rgb), .12);
40+
--md-sys-elevation-4: 0px 5px 5px -3px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 8px 10px 1px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 3px 14px 2px rgba(var(--md-sys-color-shadow-rgb), .12);
41+
--md-sys-elevation-5: 0px 8px 10px -6px rgba(var(--md-sys-color-shadow-rgb), .2), 0px 16px 24px 2px rgba(var(--md-sys-color-shadow-rgb), .14), 0px 6px 30px 5px rgba(var(--md-sys-color-shadow-rgb), .12)
42+
}

plugin/assets/css/src/tokens/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
@import "./palette.css";
1818
@import "./colors.css";
1919
@import "./shape.css";
20+
@import "./opacity.css";
21+
@import "./elevation.css";
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Copyright 2022 Google LLC
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+
:root {
18+
--md-sys-state-dragged-state-layer-opacity: 0.16;
19+
--md-sys-state-pressed-state-layer-opacity: 0.12;
20+
--md-sys-state-focus-state-layer-opacity: 0.12;
21+
--md-sys-state-hover-state-layer-opacity: 0.08
22+
}

0 commit comments

Comments
 (0)