mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
fix(switch)!: remove unselected token prefix
BREAKING CHANGE: Rename `--md-switch-unselected-<token>` to `--md-switch-<token>` PiperOrigin-RevId: 552339215
This commit is contained in:
parent
2329d2b419
commit
3681b588e0
@ -43,8 +43,8 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
|
||||
border-start-end-radius: var(--_handle-shape-start-end);
|
||||
border-end-end-radius: var(--_handle-shape-end-end);
|
||||
border-end-start-radius: var(--_handle-shape-end-start);
|
||||
height: var(--_unselected-handle-height);
|
||||
width: var(--_unselected-handle-width);
|
||||
height: var(--_handle-height);
|
||||
width: var(--_handle-width);
|
||||
|
||||
transform-origin: center;
|
||||
transition-property: height, width;
|
||||
@ -108,24 +108,24 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
|
||||
}
|
||||
|
||||
.switch--unselected .handle::before {
|
||||
background-color: var(--_unselected-handle-color);
|
||||
background-color: var(--_handle-color);
|
||||
}
|
||||
|
||||
.switch--unselected:hover .handle::before {
|
||||
background-color: var(--_unselected-hover-handle-color);
|
||||
background-color: var(--_hover-handle-color);
|
||||
}
|
||||
|
||||
.switch--unselected:focus-within .handle::before {
|
||||
background-color: var(--_unselected-focus-handle-color);
|
||||
background-color: var(--_focus-handle-color);
|
||||
}
|
||||
|
||||
.switch--unselected:active .handle::before {
|
||||
background-color: var(--_unselected-pressed-handle-color);
|
||||
background-color: var(--_pressed-handle-color);
|
||||
}
|
||||
|
||||
.switch--unselected:disabled .handle::before {
|
||||
background-color: var(--_disabled-unselected-handle-color);
|
||||
opacity: var(--_disabled-unselected-handle-opacity);
|
||||
background-color: var(--_disabled-handle-color);
|
||||
opacity: var(--_disabled-handle-opacity);
|
||||
}
|
||||
|
||||
md-ripple {
|
||||
@ -149,10 +149,10 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
|
||||
.switch--unselected md-ripple {
|
||||
@include ripple.theme(
|
||||
(
|
||||
'hover-color': var(--_unselected-hover-state-layer-color),
|
||||
'pressed-color': var(--_unselected-pressed-state-layer-color),
|
||||
'hover-opacity': var(--_unselected-hover-state-layer-opacity),
|
||||
'pressed-opacity': var(--_unselected-pressed-state-layer-opacity),
|
||||
'hover-color': var(--_hover-state-layer-color),
|
||||
'pressed-color': var(--_pressed-state-layer-color),
|
||||
'hover-opacity': var(--_hover-state-layer-opacity),
|
||||
'pressed-opacity': var(--_pressed-state-layer-opacity),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -45,26 +45,26 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard');
|
||||
}
|
||||
|
||||
.icon--off {
|
||||
width: var(--_unselected-icon-size);
|
||||
height: var(--_unselected-icon-size);
|
||||
fill: var(--_unselected-icon-color);
|
||||
width: var(--_icon-size);
|
||||
height: var(--_icon-size);
|
||||
fill: var(--_icon-color);
|
||||
}
|
||||
|
||||
.switch--unselected:hover .icon--off {
|
||||
fill: var(--_unselected-hover-icon-color);
|
||||
fill: var(--_hover-icon-color);
|
||||
}
|
||||
|
||||
.switch--unselected:focus-within .icon--off {
|
||||
fill: var(--_unselected-focus-icon-color);
|
||||
fill: var(--_focus-icon-color);
|
||||
}
|
||||
|
||||
.switch--unselected:active .icon--off {
|
||||
fill: var(--_unselected-pressed-icon-color);
|
||||
fill: var(--_pressed-icon-color);
|
||||
}
|
||||
|
||||
.switch--unselected:disabled .icon--off {
|
||||
fill: var(--_disabled-unselected-icon-color);
|
||||
opacity: var(--_disabled-unselected-icon-opacity);
|
||||
fill: var(--_disabled-icon-color);
|
||||
opacity: var(--_disabled-icon-opacity);
|
||||
}
|
||||
|
||||
.icon--on {
|
||||
|
@ -63,29 +63,29 @@
|
||||
}
|
||||
|
||||
.switch--unselected .track::before {
|
||||
background-color: var(--_unselected-track-color);
|
||||
border-color: var(--_unselected-track-outline-color);
|
||||
background-color: var(--_track-color);
|
||||
border-color: var(--_track-outline-color);
|
||||
border-style: solid;
|
||||
border-width: var(--_track-outline-width);
|
||||
}
|
||||
|
||||
.switch--unselected:hover .track::before {
|
||||
background-color: var(--_unselected-hover-track-color);
|
||||
border-color: var(--_unselected-hover-track-outline-color);
|
||||
background-color: var(--_hover-track-color);
|
||||
border-color: var(--_hover-track-outline-color);
|
||||
}
|
||||
|
||||
.switch--unselected:focus-visible .track::before {
|
||||
background-color: var(--_unselected-focus-track-color);
|
||||
border-color: var(--_unselected-focus-track-outline-color);
|
||||
background-color: var(--_focus-track-color);
|
||||
border-color: var(--_focus-track-outline-color);
|
||||
}
|
||||
|
||||
.switch--unselected:active .track::before {
|
||||
background-color: var(--_unselected-pressed-track-color);
|
||||
border-color: var(--_unselected-pressed-track-outline-color);
|
||||
background-color: var(--_pressed-track-color);
|
||||
border-color: var(--_pressed-track-outline-color);
|
||||
}
|
||||
|
||||
.switch--unselected:disabled .track::before {
|
||||
background-color: var(--_disabled-unselected-track-color);
|
||||
border-color: var(--_disabled-unselected-track-outline-color);
|
||||
background-color: var(--_disabled-track-color);
|
||||
border-color: var(--_disabled-track-outline-color);
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
'disabled-selected-icon-opacity': 1,
|
||||
'disabled-selected-track-color': GrayText,
|
||||
'disabled-track-opacity': 1,
|
||||
'disabled-unselected-handle-color': GrayText,
|
||||
'disabled-unselected-handle-opacity': 1,
|
||||
'disabled-unselected-icon-color': Canvas,
|
||||
'disabled-unselected-icon-opacity': 1,
|
||||
'disabled-handle-color': GrayText,
|
||||
'disabled-handle-opacity': 1,
|
||||
'disabled-icon-color': Canvas,
|
||||
'disabled-icon-opacity': 1,
|
||||
'selected-focus-track-color': ButtonText,
|
||||
'selected-hover-track-color': ButtonText,
|
||||
'selected-icon-color': ButtonText,
|
||||
@ -27,14 +27,14 @@
|
||||
'selected-pressed-icon-color': ButtonText,
|
||||
'selected-pressed-track-color': ButtonText,
|
||||
'selected-track-color': ButtonText,
|
||||
'unselected-focus-handle-color': ButtonText,
|
||||
'unselected-handle-color': ButtonText,
|
||||
'unselected-hover-handle-color': ButtonText,
|
||||
'unselected-icon-color': Canvas,
|
||||
'unselected-hover-icon-color': Canvas,
|
||||
'unselected-focus-icon-color': Canvas,
|
||||
'unselected-pressed-icon-color': Canvas,
|
||||
'unselected-pressed-handle-color': ButtonText,
|
||||
'focus-handle-color': ButtonText,
|
||||
'handle-color': ButtonText,
|
||||
'hover-handle-color': ButtonText,
|
||||
'icon-color': Canvas,
|
||||
'hover-icon-color': Canvas,
|
||||
'focus-icon-color': Canvas,
|
||||
'pressed-icon-color': Canvas,
|
||||
'pressed-handle-color': ButtonText,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -13,21 +13,42 @@
|
||||
|
||||
$supported-tokens: (
|
||||
// go/keep-sorted start
|
||||
'disabled-handle-color',
|
||||
'disabled-handle-opacity',
|
||||
'disabled-icon-color',
|
||||
'disabled-icon-opacity',
|
||||
'disabled-selected-handle-color',
|
||||
'disabled-selected-handle-opacity',
|
||||
'disabled-selected-icon-color',
|
||||
'disabled-selected-icon-opacity',
|
||||
'disabled-selected-track-color',
|
||||
'disabled-track-color',
|
||||
'disabled-track-opacity',
|
||||
'disabled-unselected-handle-color',
|
||||
'disabled-unselected-handle-opacity',
|
||||
'disabled-unselected-icon-color',
|
||||
'disabled-unselected-icon-opacity',
|
||||
'disabled-unselected-track-color',
|
||||
'disabled-unselected-track-outline-color',
|
||||
'disabled-track-outline-color',
|
||||
'focus-handle-color',
|
||||
'focus-icon-color',
|
||||
'focus-track-color',
|
||||
'focus-track-outline-color',
|
||||
'handle-color',
|
||||
'handle-height',
|
||||
'handle-shape',
|
||||
'handle-width',
|
||||
'hover-handle-color',
|
||||
'hover-icon-color',
|
||||
'hover-state-layer-color',
|
||||
'hover-state-layer-opacity',
|
||||
'hover-track-color',
|
||||
'hover-track-outline-color',
|
||||
'icon-color',
|
||||
'icon-size',
|
||||
'pressed-handle-color',
|
||||
'pressed-handle-height',
|
||||
'pressed-handle-width',
|
||||
'pressed-icon-color',
|
||||
'pressed-state-layer-color',
|
||||
'pressed-state-layer-opacity',
|
||||
'pressed-track-color',
|
||||
'pressed-track-outline-color',
|
||||
'selected-focus-handle-color',
|
||||
'selected-focus-icon-color',
|
||||
'selected-focus-track-color',
|
||||
@ -49,33 +70,12 @@ $supported-tokens: (
|
||||
'selected-track-color',
|
||||
'state-layer-shape',
|
||||
'state-layer-size',
|
||||
'track-color',
|
||||
'track-height',
|
||||
'track-outline-color',
|
||||
'track-outline-width',
|
||||
'track-shape',
|
||||
'track-width',
|
||||
'unselected-focus-handle-color',
|
||||
'unselected-focus-icon-color',
|
||||
'unselected-focus-track-color',
|
||||
'unselected-focus-track-outline-color',
|
||||
'unselected-handle-color',
|
||||
'unselected-handle-height',
|
||||
'unselected-handle-width',
|
||||
'unselected-hover-handle-color',
|
||||
'unselected-hover-icon-color',
|
||||
'unselected-hover-state-layer-color',
|
||||
'unselected-hover-state-layer-opacity',
|
||||
'unselected-hover-track-color',
|
||||
'unselected-hover-track-outline-color',
|
||||
'unselected-icon-color',
|
||||
'unselected-icon-size',
|
||||
'unselected-pressed-handle-color',
|
||||
'unselected-pressed-icon-color',
|
||||
'unselected-pressed-state-layer-color',
|
||||
'unselected-pressed-state-layer-opacity',
|
||||
'unselected-pressed-track-color',
|
||||
'unselected-pressed-track-outline-color',
|
||||
'unselected-track-color',
|
||||
'unselected-track-outline-color',
|
||||
'with-icon-handle-height',
|
||||
'with-icon-handle-width',
|
||||
// go/keep-sorted end
|
||||
@ -83,10 +83,10 @@ $supported-tokens: (
|
||||
|
||||
$unsupported-tokens: (
|
||||
// go/keep-sorted start
|
||||
'focus-state-layer-color',
|
||||
'focus-state-layer-opacity',
|
||||
'selected-focus-state-layer-color',
|
||||
'selected-focus-state-layer-opacity',
|
||||
'unselected-focus-state-layer-color',
|
||||
'unselected-focus-state-layer-opacity',
|
||||
// go/keep-sorted end
|
||||
);
|
||||
|
||||
@ -100,7 +100,41 @@ $_default: (
|
||||
$tokens: values.validate(
|
||||
md-comp-switch.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
$renamed-tokens: (
|
||||
// Remove default "unselected" prefix (b/292244480)
|
||||
'disabled-unselected-handle-color': 'disabled-handle-color',
|
||||
'disabled-unselected-handle-opacity': 'disabled-handle-opacity',
|
||||
'disabled-unselected-icon-color': 'disabled-icon-color',
|
||||
'disabled-unselected-icon-opacity': 'disabled-icon-opacity',
|
||||
'disabled-unselected-track-color': 'disabled-track-color',
|
||||
'disabled-unselected-track-outline-color': 'disabled-track-outline-color',
|
||||
'unselected-focus-handle-color': 'focus-handle-color',
|
||||
'unselected-focus-icon-color': 'focus-icon-color',
|
||||
'unselected-focus-state-layer-color': 'focus-state-layer-color',
|
||||
'unselected-focus-state-layer-opacity': 'focus-state-layer-opacity',
|
||||
'unselected-focus-track-color': 'focus-track-color',
|
||||
'unselected-focus-track-outline-color': 'focus-track-outline-color',
|
||||
'unselected-handle-color': 'handle-color',
|
||||
'unselected-handle-height': 'handle-height',
|
||||
'unselected-handle-width': 'handle-width',
|
||||
'unselected-hover-handle-color': 'hover-handle-color',
|
||||
'unselected-hover-icon-color': 'hover-icon-color',
|
||||
'unselected-hover-state-layer-color': 'hover-state-layer-color',
|
||||
'unselected-hover-state-layer-opacity': 'hover-state-layer-opacity',
|
||||
'unselected-hover-track-color': 'hover-track-color',
|
||||
'unselected-hover-track-outline-color': 'hover-track-outline-color',
|
||||
'unselected-icon-color': 'icon-color',
|
||||
'unselected-icon-size': 'icon-size',
|
||||
'unselected-pressed-handle-color': 'pressed-handle-color',
|
||||
'unselected-pressed-icon-color': 'pressed-icon-color',
|
||||
'unselected-pressed-state-layer-color': 'pressed-state-layer-color',
|
||||
'unselected-pressed-state-layer-opacity': 'pressed-state-layer-opacity',
|
||||
'unselected-pressed-track-color': 'pressed-track-color',
|
||||
'unselected-pressed-track-outline-color': 'pressed-track-outline-color',
|
||||
'unselected-track-color': 'track-color',
|
||||
'unselected-track-outline-color': 'track-outline-color'
|
||||
)
|
||||
);
|
||||
|
||||
@return $tokens;
|
||||
|
Loading…
Reference in New Issue
Block a user