mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 21:57:41 +03:00
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
51 lines
1.3 KiB
SCSS
51 lines
1.3 KiB
SCSS
//
|
|
// Copyright 2022 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';
|
|
@use './md-sys-color';
|
|
@use './md-sys-shape';
|
|
@use './md-sys-state';
|
|
// go/keep-sorted end
|
|
|
|
$supported-tokens: (
|
|
// go/keep-sorted start
|
|
'hover-color',
|
|
'hover-opacity',
|
|
'pressed-color',
|
|
'pressed-opacity',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
$_default: (
|
|
'md-sys-color': md-sys-color.values-light(),
|
|
'md-sys-state': md-sys-state.values(),
|
|
);
|
|
|
|
@function values($deps: $_default, $exclude-custom-properties: true) {
|
|
$tokens: (
|
|
'hover-color': map.get($deps, 'md-sys-color', 'on-surface'),
|
|
'hover-opacity': map.get($deps, 'md-sys-state', 'hover-state-layer-opacity'),
|
|
'pressed-color': map.get($deps, 'md-sys-color', 'on-surface'),
|
|
'pressed-opacity':
|
|
map.get($deps, 'md-sys-state', 'pressed-state-layer-opacity'),
|
|
);
|
|
|
|
$tokens: validate.values($tokens, $supported-tokens: $supported-tokens);
|
|
|
|
// 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-ripple-#{$token}, #{$value}));
|
|
}
|
|
}
|
|
|
|
@return $tokens;
|
|
}
|