|
4 | 4 | // |
5 | 5 |
|
6 | 6 | // go/keep-sorted start |
| 7 | +@use 'sass:list'; |
7 | 8 | @use 'sass:map'; |
8 | 9 | // go/keep-sorted end |
9 | 10 | // go/keep-sorted start |
10 | 11 | @use '../../sass/theme'; |
11 | 12 | @use '../../tokens'; |
12 | | -@use './md-comp-ripple'; |
13 | 13 | // go/keep-sorted end |
14 | 14 |
|
15 | 15 | @mixin theme($tokens) { |
16 | | - $tokens: theme.validate-theme(md-comp-ripple.values(), $tokens); |
17 | | - $tokens: theme.create-theme-vars($tokens, ripple); |
| 16 | + $supported-tokens: tokens.$md-comp-ripple-supported-tokens; |
| 17 | + @each $token, $value in $tokens { |
| 18 | + @if list.index($supported-tokens, $token) == null { |
| 19 | + @error 'Token `#{$token}` is not a supported token.'; |
| 20 | + } |
18 | 21 |
|
19 | | - @include theme.emit-theme-vars($tokens); |
| 22 | + @if $value { |
| 23 | + --md-ripple-#{$token}: #{$value}; |
| 24 | + } |
| 25 | + } |
20 | 26 | } |
21 | 27 |
|
22 | 28 | @mixin styles() { |
23 | | - $tokens: md-comp-ripple.values(); |
24 | | - $tokens: theme.create-theme-vars($tokens, ripple); |
| 29 | + $tokens: tokens.md-comp-ripple-values(); |
25 | 30 |
|
26 | 31 | :host { |
27 | 32 | @each $token, $value in $tokens { |
28 | | - --_#{$token}: #{$value}; |
| 33 | + --_#{$token}: var(--md-ripple-#{$token}, #{$value}); |
29 | 34 | } |
30 | | - } |
31 | 35 |
|
32 | | - :host { |
33 | 36 | display: flex; |
34 | 37 | } |
35 | 38 |
|
|
39 | 42 |
|
40 | 43 | :host, |
41 | 44 | .surface { |
| 45 | + border-radius: inherit; |
42 | 46 | position: absolute; |
43 | 47 | inset: 0; |
44 | 48 | pointer-events: none; |
45 | 49 | overflow: hidden; |
46 | 50 | } |
47 | 51 |
|
48 | 52 | .surface { |
49 | | - // TODO(https://bugs.webkit.org/show_bug.cgi?id=247546) |
50 | | - // Remove Safari workaround for incorrect ripple overflow when addressed. |
51 | | - // This addresses `hover` and `pressed` state oveflow. |
52 | | - will-change: transform; |
53 | | - border-radius: var(--_shape); |
54 | 53 | outline: none; |
55 | 54 | -webkit-tap-highlight-color: transparent; |
56 | 55 |
|
|
97 | 96 | transition-duration: 105ms; |
98 | 97 | } |
99 | 98 |
|
100 | | - .unbounded { |
101 | | - $unbounded: ( |
102 | | - shape: map.get(tokens.md-sys-shape-values(), 'corner-full'), |
103 | | - ); |
104 | | - $unbounded: theme.create-theme-vars($unbounded, ripple); |
105 | | - |
106 | | - --_shape: #{map.get($unbounded, 'shape')}; |
107 | | - } |
108 | | - |
109 | 99 | @media screen and (forced-colors: active) { |
110 | 100 | :host { |
111 | 101 | display: none; |
|
0 commit comments