material-web/tokens/_md-comp-icon.scss
Elizabeth Mitchell feff7214a7 feat(tokens): add component custom properties to Sass values
These are excluded by default, but will be enabled by default in 2.0.

Example: `tokens.md-comp-checkbox-values($exclude-custom-properties: false)`
PiperOrigin-RevId: 601596085
2024-01-25 16:10:32 -08:00

49 lines
1.1 KiB
SCSS

//
// Copyright 2023 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// go/keep-sorted start
@use 'sass:map';
// go/keep-sorted end
// go/keep-sorted start
@use './internal/validate';
// go/keep-sorted end
$supported-tokens: (
// go/keep-sorted start
'font',
'size',
// go/keep-sorted end
);
@function _get-new-tokens($exclude-hardcoded-values) {
@return (
// go/keep-sorted start
font: if($exclude-hardcoded-values, null, 'Material Symbols Outlined'),
size: if($exclude-hardcoded-values, null, 24px),
// go/keep-sorted end
);
}
@function values(
$exclude-hardcoded-values: false,
$exclude-custom-properties: true
) {
$tokens: validate.values(
(),
$supported-tokens: $supported-tokens,
$new-tokens: _get-new-tokens($exclude-hardcoded-values)
);
// Default to `$exclude-custom-properties: false` in the next breaking change.
// See b/321816473.
@if not $exclude-custom-properties {
@each $token, $value in $tokens {
$tokens: map.set($tokens, $token, var(--md-icon-#{$token}, #{$value}));
}
}
@return $tokens;
}