mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 21:57:41 +03:00
a3a05e4179
The naming is a bit backwards. The file is about validation and the function is for the token values, not a file just for token values. PiperOrigin-RevId: 599207580
47 lines
971 B
SCSS
47 lines
971 B
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';
|
|
@use './v0_192/md-ref-typeface';
|
|
// go/keep-sorted end
|
|
|
|
$supported-tokens: (
|
|
// go/keep-sorted start
|
|
'brand',
|
|
'plain',
|
|
'weight-bold',
|
|
'weight-medium',
|
|
'weight-regular',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
@function values(
|
|
$exclude-hardcoded-values: false,
|
|
$exclude-custom-properties: false
|
|
) {
|
|
$tokens: md-ref-typeface.values(
|
|
$exclude-hardcoded-values: $exclude-hardcoded-values,
|
|
);
|
|
|
|
@if not $exclude-custom-properties {
|
|
// Create --md-ref-typeface-* custom properties
|
|
@each $token, $value in $tokens {
|
|
@if $value != null {
|
|
$tokens: map.set(
|
|
$tokens,
|
|
$token,
|
|
var(--md-ref-typeface-#{$token}, #{$value})
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
@return validate.values($tokens, $supported-tokens: $supported-tokens);
|
|
}
|