mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
BREAKING CHANGE: replace `label-text-type` tokens with `label-text-font`, `-size`, `-line-height`, and `-weight` PiperOrigin-RevId: 563153211
109 lines
3.1 KiB
SCSS
109 lines
3.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 './md-sys-color';
|
|
@use './md-sys-shape';
|
|
@use './md-sys-state';
|
|
@use './md-sys-typescale';
|
|
@use './v0_172/md-comp-outlined-button';
|
|
@use './values';
|
|
// go/keep-sorted end
|
|
|
|
$supported-tokens: (
|
|
// go/keep-sorted start
|
|
'container-height',
|
|
'container-shape',
|
|
'disabled-icon-color',
|
|
'disabled-icon-opacity',
|
|
'disabled-label-text-color',
|
|
'disabled-label-text-opacity',
|
|
'disabled-outline-color',
|
|
'disabled-outline-opacity',
|
|
'focus-icon-color',
|
|
'focus-label-text-color',
|
|
'hover-icon-color',
|
|
'hover-label-text-color',
|
|
'hover-state-layer-color',
|
|
'hover-state-layer-opacity',
|
|
'icon-color',
|
|
'icon-size',
|
|
'label-text-color',
|
|
'label-text-font',
|
|
'label-text-line-height',
|
|
'label-text-size',
|
|
'label-text-weight',
|
|
'leading-space',
|
|
'outline-color',
|
|
'outline-width',
|
|
'pressed-icon-color',
|
|
'pressed-label-text-color',
|
|
'pressed-outline-color',
|
|
'pressed-state-layer-color',
|
|
'pressed-state-layer-opacity',
|
|
'trailing-space',
|
|
'with-leading-icon-leading-space',
|
|
'with-leading-icon-trailing-space',
|
|
'with-trailing-icon-leading-space',
|
|
'with-trailing-icon-trailing-space',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
$unsupported-tokens: (
|
|
// go/keep-sorted start
|
|
'focus-outline-color',
|
|
'focus-state-layer-color',
|
|
'focus-state-layer-opacity',
|
|
'hover-outline-color',
|
|
'label-text-tracking',
|
|
'label-text-type',
|
|
// go/keep-sorted end
|
|
);
|
|
|
|
$_default: (
|
|
'md-sys-color': md-sys-color.values-light(),
|
|
'md-sys-shape': md-sys-shape.values(),
|
|
'md-sys-state': md-sys-state.values(),
|
|
'md-sys-typescale': md-sys-typescale.values(),
|
|
);
|
|
|
|
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
|
$tokens: values.validate(
|
|
md-comp-outlined-button.values($deps, $exclude-hardcoded-values),
|
|
$supported-tokens: $supported-tokens,
|
|
$unsupported-tokens: $unsupported-tokens,
|
|
$new-tokens: (
|
|
// TODO(b/198759625): Remove once spacing tokens are formally added
|
|
// go/keep-sorted start
|
|
'leading-space': if($exclude-hardcoded-values, null, 24px),
|
|
'trailing-space': if($exclude-hardcoded-values, null, 24px),
|
|
'with-leading-icon-leading-space':
|
|
if($exclude-hardcoded-values, null, 16px),
|
|
'with-leading-icon-trailing-space':
|
|
if($exclude-hardcoded-values, null, 24px),
|
|
'with-trailing-icon-leading-space':
|
|
if($exclude-hardcoded-values, null, 24px),
|
|
'with-trailing-icon-trailing-space':
|
|
if($exclude-hardcoded-values, null, 16px),
|
|
// go/keep-sorted end
|
|
),
|
|
$renamed-tokens: (
|
|
// Remove "with-*" prefixes (b/273534858)
|
|
'with-icon-disabled-icon-color': 'disabled-icon-color',
|
|
'with-icon-disabled-icon-opacity': 'disabled-icon-opacity',
|
|
'with-icon-focus-icon-color': 'focus-icon-color',
|
|
'with-icon-hover-icon-color': 'hover-icon-color',
|
|
'with-icon-icon-color': 'icon-color',
|
|
'with-icon-icon-size': 'icon-size',
|
|
'with-icon-pressed-icon-color': 'pressed-icon-color'
|
|
)
|
|
);
|
|
|
|
@return $tokens;
|
|
}
|