mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 21:57:41 +03:00
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
150 lines
3.3 KiB
SCSS
150 lines
3.3 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';
|
|
@use './md-ref-typeface';
|
|
@use './v0_192/md-sys-typescale';
|
|
// go/keep-sorted end
|
|
|
|
$supported-tokens: (
|
|
// go/keep-sorted start
|
|
'body-large-font',
|
|
'body-large-line-height',
|
|
'body-large-size',
|
|
'body-large-weight',
|
|
'body-medium-font',
|
|
'body-medium-line-height',
|
|
'body-medium-size',
|
|
'body-medium-weight',
|
|
'body-small-font',
|
|
'body-small-line-height',
|
|
'body-small-size',
|
|
'body-small-weight',
|
|
'display-large-font',
|
|
'display-large-line-height',
|
|
'display-large-size',
|
|
'display-large-weight',
|
|
'display-medium-font',
|
|
'display-medium-line-height',
|
|
'display-medium-size',
|
|
'display-medium-weight',
|
|
'display-small-font',
|
|
'display-small-line-height',
|
|
'display-small-size',
|
|
'display-small-weight',
|
|
'headline-large-font',
|
|
'headline-large-line-height',
|
|
'headline-large-size',
|
|
'headline-large-weight',
|
|
'headline-medium-font',
|
|
'headline-medium-line-height',
|
|
'headline-medium-size',
|
|
'headline-medium-weight',
|
|
'headline-small-font',
|
|
'headline-small-line-height',
|
|
'headline-small-size',
|
|
'headline-small-weight',
|
|
'label-large-font',
|
|
'label-large-line-height',
|
|
'label-large-size',
|
|
'label-large-weight',
|
|
'label-large-weight-prominent',
|
|
'label-medium-font',
|
|
'label-medium-line-height',
|
|
'label-medium-size',
|
|
'label-medium-weight',
|
|
'label-medium-weight-prominent',
|
|
'label-small-font',
|
|
'label-small-line-height',
|
|
'label-small-size',
|
|
'label-small-weight',
|
|
'title-large-font',
|
|
'title-large-line-height',
|
|
'title-large-size',
|
|
'title-large-weight',
|
|
'title-medium-font',
|
|
'title-medium-line-height',
|
|
'title-medium-size',
|
|
'title-medium-weight',
|
|
'title-small-font',
|
|
'title-small-line-height',
|
|
'title-small-size',
|
|
'title-small-weight',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
$unsupported-tokens: (
|
|
// go/keep-sorted start
|
|
'body-large',
|
|
'body-large-tracking',
|
|
'body-medium',
|
|
'body-medium-tracking',
|
|
'body-small',
|
|
'body-small-tracking',
|
|
'display-large',
|
|
'display-large-tracking',
|
|
'display-medium',
|
|
'display-medium-tracking',
|
|
'display-small',
|
|
'display-small-tracking',
|
|
'headline-large',
|
|
'headline-large-tracking',
|
|
'headline-medium',
|
|
'headline-medium-tracking',
|
|
'headline-small',
|
|
'headline-small-tracking',
|
|
'label-large',
|
|
'label-large-tracking',
|
|
'label-medium',
|
|
'label-medium-tracking',
|
|
'label-small',
|
|
'label-small-tracking',
|
|
'title-large',
|
|
'title-large-tracking',
|
|
'title-medium',
|
|
'title-medium-tracking',
|
|
'title-small',
|
|
'title-small-tracking',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
$_default: (
|
|
'md-ref-typeface': md-ref-typeface.values(),
|
|
);
|
|
|
|
@function values(
|
|
$deps: $_default,
|
|
$exclude-hardcoded-values: false,
|
|
$exclude-custom-properties: false
|
|
) {
|
|
$tokens: md-sys-typescale.values(
|
|
$deps,
|
|
$exclude-hardcoded-values: $exclude-hardcoded-values
|
|
);
|
|
|
|
@if not $exclude-custom-properties {
|
|
// Create --md-sys-typescale-* custom properties
|
|
@each $token, $value in $tokens {
|
|
@if $value != null {
|
|
$tokens: map.set(
|
|
$tokens,
|
|
$token,
|
|
var(--md-sys-typescale-#{$token}, #{$value})
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
@return validate.values(
|
|
$tokens,
|
|
$supported-tokens: $supported-tokens,
|
|
$unsupported-tokens: $unsupported-tokens
|
|
);
|
|
}
|