|
170 | 170 | }
|
171 | 171 | @else if($color != null) {
|
172 | 172 | $result: map.remove($result, $opacity-key);
|
173 |
| - $result: map.set($result, $color-key, #{color(from #{$color} srgb r g b / #{$opacity})}); |
| 173 | + $combined-color: #{color-mix(in srgb, #{$color} #{($opacity * 100) + '%'}, transparent)}; |
| 174 | + $result: map.set($result, $color-key, $combined-color); |
174 | 175 | }
|
175 | 176 | }
|
176 | 177 |
|
|
1029 | 1030 | }
|
1030 | 1031 | }
|
1031 | 1032 |
|
1032 |
| -@function _get-sys-color($type, $use-sys-vars, $ref) { |
1033 |
| - @if $use-sys-vars { |
| 1033 | +@function _get-sys-color($type, $ref) { |
| 1034 | + @if (sass-utils.$use-system-color-variables) { |
1034 | 1035 | @return (
|
1035 | 1036 | 'background': var(--sys-background),
|
1036 | 1037 | 'error': var(--sys-error),
|
|
1089 | 1090 | mdc-tokens.md-sys-color-values-light($ref));
|
1090 | 1091 | }
|
1091 | 1092 |
|
1092 |
| -@function _get-sys-typeface($use-sys-vars, $ref) { |
1093 |
| - @if ($use-sys-vars) { |
| 1093 | +@function _get-sys-typeface($ref) { |
| 1094 | + @if (sass-utils.$use-system-typography-variables) { |
1094 | 1095 | @return (
|
1095 | 1096 | 'body-large': var(--sys-body-large),
|
1096 | 1097 | 'body-large-font': var(--sys-body-large-font),
|
|
1195 | 1196 | /// @param {Map} $tertiary The tertiary palette
|
1196 | 1197 | /// @param {Map} $error The error palette
|
1197 | 1198 | /// @return {Map} A map of namespaced color tokens
|
1198 |
| -@function generate-color-tokens($type, $primary, $tertiary, $error, $use-sys-vars) { |
| 1199 | +@function generate-color-tokens($type, $primary, $tertiary, $error) { |
1199 | 1200 | $ref: (
|
1200 | 1201 | md-ref-palette: _generate-ref-palette-tokens($primary, $tertiary, $error)
|
1201 | 1202 | );
|
1202 | 1203 |
|
1203 |
| - $sys-color: _get-sys-color($type, $use-sys-vars, $ref); |
| 1204 | + $sys-color: _get-sys-color($type, $ref); |
1204 | 1205 |
|
1205 | 1206 | @return _generate-tokens(map.merge($ref, (
|
1206 | 1207 | md-sys-color: $sys-color,
|
|
1222 | 1223 | /// @param {String|Number} $medium The medium font-weight
|
1223 | 1224 | /// @param {String|Number} $regular The regular font-weight
|
1224 | 1225 | /// @return {Map} A map of namespaced typography tokens
|
1225 |
| -@function generate-typography-tokens($brand, $plain, $bold, $medium, $regular, $use-sys-vars) { |
| 1226 | +@function generate-typography-tokens($brand, $plain, $bold, $medium, $regular) { |
1226 | 1227 | $ref: (
|
1227 | 1228 | md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
|
1228 | 1229 | );
|
1229 |
| - $sys-typeface: _get-sys-typeface($use-sys-vars, $ref); |
| 1230 | + $sys-typeface: _get-sys-typeface($ref); |
1230 | 1231 | @return _generate-tokens((
|
1231 | 1232 | md-sys-typescale: $sys-typeface
|
1232 | 1233 | ));
|
|
0 commit comments