diff --git a/button/lib/_shared.scss b/button/lib/_shared.scss index f7756138b0..bfae3ba29f 100644 --- a/button/lib/_shared.scss +++ b/button/lib/_shared.scss @@ -29,10 +29,8 @@ @include ripple.theme( ( hover-color: var(--_hover-state-layer-color), - focus-color: var(--_focus-state-layer-color), pressed-color: var(--_pressed-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), - focus-opacity: var(--_focus-state-layer-opacity), pressed-opacity: var(--_pressed-state-layer-opacity), ) ); diff --git a/checkbox/lib/_checkbox.scss b/checkbox/lib/_checkbox.scss index 42c1d0ae6f..24e07dfa50 100644 --- a/checkbox/lib/_checkbox.scss +++ b/checkbox/lib/_checkbox.scss @@ -175,8 +175,6 @@ $_checkmark-bottom-left: 7px, -14px; @include ripple.theme( ( - focus-color: var(--_unselected-focus-state-layer-color), - focus-opacity: var(--_unselected-focus-state-layer-opacity), hover-color: var(--_unselected-hover-state-layer-color), hover-opacity: var(--_unselected-hover-state-layer-opacity), pressed-color: var(--_unselected-pressed-state-layer-color), @@ -188,8 +186,6 @@ $_checkmark-bottom-left: 7px, -14px; .selected md-ripple { @include ripple.theme( ( - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_selected-focus-state-layer-opacity), hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_selected-hover-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), @@ -201,8 +197,6 @@ $_checkmark-bottom-left: 7px, -14px; .error md-ripple { @include ripple.theme( ( - focus-color: var(--_error-focus-state-layer-color), - focus-opacity: var(--_error-focus-state-layer-opacity), hover-color: var(--_error-hover-state-layer-color), hover-opacity: var(--_error-hover-state-layer-opacity), pressed-color: var(--_error-pressed-state-layer-color), diff --git a/chips/lib/_selectable.scss b/chips/lib/_selectable.scss index cf4a8f70c3..a5a1a08e2b 100644 --- a/chips/lib/_selectable.scss +++ b/chips/lib/_selectable.scss @@ -11,8 +11,6 @@ .selected { @include ripple.theme( ( - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_selected-focus-state-layer-opacity), hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_selected-hover-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), diff --git a/chips/lib/_shared.scss b/chips/lib/_shared.scss index bfc431c105..1cf3b984da 100644 --- a/chips/lib/_shared.scss +++ b/chips/lib/_shared.scss @@ -23,8 +23,6 @@ @include ripple.theme( ( - 'focus-color': var(--_focus-state-layer-color), - 'focus-opacity': var(--_focus-state-layer-opacity), 'hover-color': var(--_hover-state-layer-color), 'hover-opacity': var(--_hover-state-layer-opacity), 'pressed-color': var(--_pressed-state-layer-color), diff --git a/fab/lib/_fab.scss b/fab/lib/_fab.scss index 54dc15919a..bf57b3d0b2 100644 --- a/fab/lib/_fab.scss +++ b/fab/lib/_fab.scss @@ -117,7 +117,6 @@ ( 'container-color': var(--_primary-container-color), 'focus-icon-color': var(--_primary-focus-icon-color), - 'focus-state-layer-color': var(--_primary-focus-state-layer-color), 'hover-icon-color': var(--_primary-hover-icon-color), 'hover-state-layer-color': var(--_primary-hover-state-layer-color), 'icon-color': var(--_primary-icon-color), @@ -136,7 +135,6 @@ ( 'container-color': var(--_secondary-container-color), 'focus-icon-color': var(--_secondary-focus-icon-color), - 'focus-state-layer-color': var(--_secondary-focus-state-layer-color), 'hover-icon-color': var(--_secondary-hover-icon-color), 'hover-state-layer-color': var(--_secondary-hover-state-layer-color), 'icon-color': var(--_secondary-icon-color), @@ -156,7 +154,6 @@ ( 'container-color': var(--_tertiary-container-color), 'focus-icon-color': var(--_tertiary-focus-icon-color), - 'focus-state-layer-color': var(--_tertiary-focus-state-layer-color), 'hover-icon-color': var(--_tertiary-hover-icon-color), 'hover-state-layer-color': var(--_tertiary-hover-state-layer-color), 'icon-color': var(--_tertiary-icon-color), @@ -206,7 +203,6 @@ @include ripple.theme( ( hover-color: map.get($colors, hover-state-layer-color), - focus-color: map.get($colors, focus-state-layer-color), pressed-color: map.get($colors, pressed-state-layer-color), ) ); diff --git a/fab/lib/_shared.scss b/fab/lib/_shared.scss index a5cbb5a8f4..0300bb619b 100644 --- a/fab/lib/_shared.scss +++ b/fab/lib/_shared.scss @@ -21,7 +21,6 @@ $_md-sys-motion: tokens.md-sys-motion-values(); @include ripple.theme( ( hover-opacity: var(--_hover-state-layer-opacity), - focus-opacity: var(--_focus-state-layer-opacity), pressed-opacity: var(--_pressed-state-layer-opacity), ) ); @@ -113,7 +112,6 @@ $_md-sys-motion: tokens.md-sys-motion-values(); @include fab.color( ( 'container-color': var(--_container-color), - 'focus-state-layer-color': var(--_focus-state-layer-color), 'hover-state-layer-color': var(--_hover-state-layer-color), 'pressed-state-layer-color': var(--_pressed-state-layer-color), 'label-text-color': var(--_label-text-color), diff --git a/iconbutton/lib/_filled-icon-button.scss b/iconbutton/lib/_filled-icon-button.scss index 0c4943c198..f637bff027 100644 --- a/iconbutton/lib/_filled-icon-button.scss +++ b/iconbutton/lib/_filled-icon-button.scss @@ -82,8 +82,6 @@ @include ripple.theme( ( - focus-color: var(--_focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), hover-color: var(--_hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), pressed-color: var(--_pressed-state-layer-color), @@ -130,7 +128,6 @@ @include ripple.theme( ( - focus-color: var(--_toggle-unselected-focus-state-layer-color), hover-color: var(--_toggle-unselected-hover-state-layer-color), pressed-color: var(--_toggle-unselected-pressed-state-layer-color), ) @@ -160,7 +157,6 @@ @include ripple.theme( ( - focus-color: var(--_toggle-selected-focus-state-layer-color), hover-color: var(--_toggle-selected-hover-state-layer-color), pressed-color: var(--_toggle-selected-pressed-state-layer-color), ) diff --git a/iconbutton/lib/_filled-tonal-icon-button.scss b/iconbutton/lib/_filled-tonal-icon-button.scss index 47e7ed112d..5b8795bdad 100644 --- a/iconbutton/lib/_filled-tonal-icon-button.scss +++ b/iconbutton/lib/_filled-tonal-icon-button.scss @@ -84,8 +84,6 @@ $_custom-property-prefix: 'filled-tonal-icon-button'; @include ripple.theme( ( - focus-color: var(--_focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), hover-color: var(--_hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), pressed-color: var(--_pressed-state-layer-color), @@ -132,7 +130,6 @@ $_custom-property-prefix: 'filled-tonal-icon-button'; @include ripple.theme( ( - focus-color: var(--_toggle-unselected-focus-state-layer-color), hover-color: var(--_toggle-unselected-hover-state-layer-color), pressed-color: var(--_toggle-unselected-pressed-state-layer-color), ) @@ -162,7 +159,6 @@ $_custom-property-prefix: 'filled-tonal-icon-button'; @include ripple.theme( ( - focus-color: var(--_toggle-selected-focus-state-layer-color), hover-color: var(--_toggle-selected-hover-state-layer-color), pressed-color: var(--_toggle-selected-pressed-state-layer-color), ) diff --git a/iconbutton/lib/_outlined-icon-button.scss b/iconbutton/lib/_outlined-icon-button.scss index b8323754fd..de43769b24 100644 --- a/iconbutton/lib/_outlined-icon-button.scss +++ b/iconbutton/lib/_outlined-icon-button.scss @@ -68,8 +68,6 @@ @include ripple.theme( ( - focus-color: var(--_unselected-focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), hover-color: var(--_unselected-hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), pressed-color: var(--_unselected-pressed-state-layer-color), @@ -146,8 +144,6 @@ @include ripple.theme( ( - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), diff --git a/iconbutton/lib/_standard-icon-button.scss b/iconbutton/lib/_standard-icon-button.scss index 1705138929..150272905d 100644 --- a/iconbutton/lib/_standard-icon-button.scss +++ b/iconbutton/lib/_standard-icon-button.scss @@ -51,8 +51,6 @@ @include ripple.theme( ( - focus-color: var(--_unselected-focus-state-layer-color), - focus-opacity: var(--_unselected-focus-state-layer-opacity), hover-color: var(--_unselected-hover-state-layer-color), hover-opacity: var(--_unselected-hover-state-layer-opacity), pressed-color: var(--_unselected-pressed-state-layer-color), @@ -104,8 +102,6 @@ @include ripple.theme( ( - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_selected-focus-state-layer-opacity), hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_selected-hover-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), diff --git a/list/lib/listitem/_list-item.scss b/list/lib/listitem/_list-item.scss index c404d6817b..94ccb002fb 100644 --- a/list/lib/listitem/_list-item.scss +++ b/list/lib/listitem/_list-item.scss @@ -56,8 +56,6 @@ hover-opacity: var(--_list-item-hover-state-layer-opacity), pressed-color: var(--_list-item-pressed-state-layer-color), pressed-opacity: var(--_list-item-pressed-state-layer-opacity), - focus-color: var(--_list-item-focus-state-layer-color), - focus-opacity: var(--_list-item-focus-state-layer-opacity), ) ); } diff --git a/navigationtab/lib/_navigation-tab.scss b/navigationtab/lib/_navigation-tab.scss index 59e444f162..eba1aa78d1 100644 --- a/navigationtab/lib/_navigation-tab.scss +++ b/navigationtab/lib/_navigation-tab.scss @@ -199,10 +199,8 @@ $_custom-property-prefix: 'navigation-bar'; @include ripple.theme( ( hover-color: var(--_active-hover-state-layer-color), - focus-color: var(--_active-focus-state-layer-color), pressed-color: var(--_active-pressed-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), - focus-opacity: var(--_focus-state-layer-opacity), pressed-opacity: var(--_pressed-state-layer-opacity), ) ); @@ -250,10 +248,8 @@ $_custom-property-prefix: 'navigation-bar'; @include ripple.theme( ( hover-color: var(--_inactive-hover-state-layer-color), - focus-color: var(--_inactive-focus-state-layer-color), pressed-color: var(--_inactive-pressed-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), - focus-opacity: var(--_focus-state-layer-opacity), pressed-opacity: var(--_pressed-state-layer-opacity), ) ); diff --git a/radio/lib/_radio.scss b/radio/lib/_radio.scss index 06d87803ae..ec082279dc 100644 --- a/radio/lib/_radio.scss +++ b/radio/lib/_radio.scss @@ -4,38 +4,42 @@ // // go/keep-sorted start +@use 'sass:list'; @use 'sass:map'; // go/keep-sorted end // go/keep-sorted start @use '../../focus/focus-ring'; @use '../../motion/animation'; @use '../../ripple/ripple'; -@use '../../sass/theme'; @use '../../tokens'; // go/keep-sorted end $_md-sys-motion: tokens.md-sys-motion-values(); @mixin theme($tokens) { - $tokens: theme.validate-theme(tokens.md-comp-radio-button-values(), $tokens); - $tokens: theme.create-theme-vars($tokens, 'radio'); + $supported-tokens: tokens.$md-comp-radio-button-supported-tokens; - @include theme.emit-theme-vars($tokens); + @each $token, $value in $tokens { + @if list.index($supported-tokens, $token) == null { + @error 'Token `#{$token}` is not a supported token.'; + } + + @if $value { + --md-radio-#{$token}: #{$value}; + } + } } @mixin styles() { $tokens: tokens.md-comp-radio-button-values(); - $tokens: theme.create-theme-vars($tokens, 'radio'); :host { @each $token, $value in $tokens { - --_#{$token}: #{$value}; + --_#{$token}: var(--md-radio-#{$token}, #{$value}); } @include ripple.theme( ( - focus-color: var(--_unselected-focus-state-layer-color), - focus-opacity: var(--_unselected-focus-state-layer-opacity), hover-color: var(--_unselected-hover-state-layer-color), hover-opacity: var(--_unselected-hover-state-layer-opacity), pressed-color: var(--_unselected-pressed-state-layer-color), @@ -61,8 +65,6 @@ $_md-sys-motion: tokens.md-sys-motion-values(); :host([checked]) { @include ripple.theme( ( - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_selected-focus-state-layer-opacity), hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_selected-hover-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), diff --git a/ripple/lib/_ripple.scss b/ripple/lib/_ripple.scss index 84819cb2f8..04ef25f33b 100644 --- a/ripple/lib/_ripple.scss +++ b/ripple/lib/_ripple.scss @@ -88,12 +88,6 @@ opacity: var(--_hover-opacity); } - .focused::before { - background-color: var(--_focus-color); - opacity: var(--_focus-opacity); - transition-duration: 75ms; - } - .pressed::after { // press ripple fade-in opacity: var(--_pressed-opacity); diff --git a/ripple/lib/ripple.ts b/ripple/lib/ripple.ts index b6625b0fd3..c3e8e0c79a 100644 --- a/ripple/lib/ripple.ts +++ b/ripple/lib/ripple.ts @@ -80,7 +80,6 @@ export class Ripple extends LitElement { @property({type: Boolean, reflect: true}) disabled = false; @state() private hovered = false; - @state() private focused = false; @state() private pressed = false; @query('.surface') private readonly mdRoot!: HTMLElement|null; @@ -113,14 +112,6 @@ export class Ripple extends LitElement { } } - handleFocusin() { - this.focused = true; - } - - handleFocusout() { - this.focused = false; - } - handlePointerup(event: PointerEvent) { if (!this.shouldReactToEvent(event)) { return; @@ -212,7 +203,6 @@ export class Ripple extends LitElement { protected override render() { const classes = { 'hovered': this.hovered, - 'focused': this.focused, 'pressed': this.pressed, }; @@ -222,7 +212,6 @@ export class Ripple extends LitElement { protected override update(changedProps: PropertyValues) { if (changedProps.has('disabled') && this.disabled) { this.hovered = false; - this.focused = false; this.pressed = false; } super.update(changedProps); diff --git a/ripple/lib/ripple_test.ts b/ripple/lib/ripple_test.ts index 5b08b32f8a..63cdfcfb1f 100644 --- a/ripple/lib/ripple_test.ts +++ b/ripple/lib/ripple_test.ts @@ -16,7 +16,6 @@ import {Ripple} from './ripple.js'; enum RippleStateClasses { HOVERED = 'hovered', - FOCUSED = 'focused', PRESSED = 'pressed', } @@ -40,9 +39,7 @@ describe('Ripple', () => { async function setupTest() { const rippleRef = createRef(); const root = env.render(html` -
rippleRef.value || null)} - @focusin=${() => rippleRef.value?.handleFocusin()} - @focusout=${() => rippleRef.value?.handleFocusout()}> +
rippleRef.value || null)}>
`); @@ -98,23 +95,6 @@ describe('Ripple', () => { expect(surface).not.toHaveClass(RippleStateClasses.PRESSED); }); - it('sets focused class on focus', async () => { - const {harness, surface} = await setupTest(); - await harness.focusWithKeyboard(); - await env.waitForStability(); - - expect(surface).toHaveClass(RippleStateClasses.FOCUSED); - }); - - it('removes focused class on blur', async () => { - const {harness, surface} = await setupTest(); - await harness.focusWithKeyboard(); - await harness.blur(); - await env.waitForStability(); - - expect(surface).not.toHaveClass(RippleStateClasses.FOCUSED); - }); - it('sets hover class on pointer enter', async () => { const {harness, surface} = await setupTest(); await harness.startHover(); @@ -142,6 +122,7 @@ describe('Ripple', () => { expect(surface).not.toHaveClass(RippleStateClasses.HOVERED); }); + it('responds to keyboard click after mouse click', async () => { const {instance, harness} = await setupTest(); const STATE_INACTIVE = 0; diff --git a/segmentedbutton/lib/_shared.scss b/segmentedbutton/lib/_shared.scss index f4bc424204..09144f8e66 100644 --- a/segmentedbutton/lib/_shared.scss +++ b/segmentedbutton/lib/_shared.scss @@ -194,8 +194,6 @@ ( hover-color: var(--_unselected-hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), - focus-color: var(--_unselected-focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), pressed-color: var(--_unselected-pressed-state-layer-color), pressed-opacity: var(--_pressed-state-layer-opacity), ) @@ -241,8 +239,6 @@ ( hover-color: var(--_selected-hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), - focus-color: var(--_selected-focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), pressed-color: var(--_selected-pressed-state-layer-color), pressed-opacity: var(--_pressed-state-layer-opacity), ) diff --git a/switch/lib/_handle.scss b/switch/lib/_handle.scss index 3e524cad6a..ad11f2d72f 100644 --- a/switch/lib/_handle.scss +++ b/switch/lib/_handle.scss @@ -139,10 +139,8 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard'); @include ripple.theme( ( 'hover-color': var(--_selected-hover-state-layer-color), - 'focus-color': var(--_selected-focus-state-layer-color), 'pressed-color': var(--_selected-pressed-state-layer-color), 'hover-opacity': var(--_selected-hover-state-layer-opacity), - 'focus-opacity': var(--_selected-focus-state-layer-opacity), 'pressed-opacity': var(--_selected-pressed-state-layer-opacity), ) ); @@ -152,10 +150,8 @@ $_easing-standard: map.get($_md-sys-motion, 'easing-standard'); @include ripple.theme( ( 'hover-color': var(--_unselected-hover-state-layer-color), - 'focus-color': var(--_unselected-focus-state-layer-color), 'pressed-color': var(--_unselected-pressed-state-layer-color), 'hover-opacity': var(--_unselected-hover-state-layer-opacity), - 'focus-opacity': var(--_unselected-focus-state-layer-opacity), 'pressed-opacity': var(--_unselected-pressed-state-layer-opacity), ) ); diff --git a/tabs/lib/_tab.scss b/tabs/lib/_tab.scss index 9e3640b29b..55e1dad51e 100644 --- a/tabs/lib/_tab.scss +++ b/tabs/lib/_tab.scss @@ -43,8 +43,6 @@ @include ripple.theme( ( - focus-color: var(--_focus-state-layer-color), - focus-opacity: var(--_focus-state-layer-opacity), hover-color: var(--_hover-state-layer-color), hover-opacity: var(--_hover-state-layer-opacity), pressed-color: var(--_pressed-state-layer-color), @@ -191,8 +189,6 @@ @include ripple.theme( ( - focus-color: var(--_active-focus-state-layer-color), - focus-opacity: var(--_active-focus-state-layer-opacity), hover-color: var(--_active-hover-state-layer-color), hover-opacity: var(--_active-hover-state-layer-opacity), pressed-color: var(--_active-pressed-state-layer-color), diff --git a/tokens/_md-comp-assist-chip.scss b/tokens/_md-comp-assist-chip.scss index 4237660a9e..6454dc3e99 100644 --- a/tokens/_md-comp-assist-chip.scss +++ b/tokens/_md-comp-assist-chip.scss @@ -38,8 +38,6 @@ $supported-tokens: ( 'focus-label-text-color', 'focus-leading-icon-color', 'focus-outline-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-label-text-color', 'hover-leading-icon-color', 'hover-state-layer-color', @@ -65,6 +63,8 @@ $unsupported-tokens: ( 'dragged-leading-icon-color', 'dragged-state-layer-color', 'dragged-state-layer-opacity', + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-checkbox.scss b/tokens/_md-comp-checkbox.scss index 52751fcf46..c49603bf72 100644 --- a/tokens/_md-comp-checkbox.scss +++ b/tokens/_md-comp-checkbox.scss @@ -15,8 +15,6 @@ $supported-tokens: ( // go/keep-sorted start 'container-shape', 'container-size', - 'error-focus-state-layer-color', - 'error-focus-state-layer-opacity', 'error-hover-state-layer-color', 'error-hover-state-layer-opacity', 'error-pressed-state-layer-color', @@ -36,8 +34,6 @@ $supported-tokens: ( 'selected-error-pressed-icon-color', 'selected-focus-container-color', 'selected-focus-icon-color', - 'selected-focus-state-layer-color', - 'selected-focus-state-layer-opacity', 'selected-hover-container-color', 'selected-hover-icon-color', 'selected-hover-state-layer-color', @@ -58,8 +54,6 @@ $supported-tokens: ( 'unselected-error-pressed-outline-color', 'unselected-focus-outline-color', 'unselected-focus-outline-width', - 'unselected-focus-state-layer-color', - 'unselected-focus-state-layer-opacity', 'unselected-hover-outline-color', 'unselected-hover-outline-width', 'unselected-hover-state-layer-color', @@ -75,11 +69,18 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'error-focus-state-layer-color', + 'error-focus-state-layer-opacity', 'selected-disabled-container-outline-width', 'selected-focus-outline-width', + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', 'selected-hover-outline-width', 'selected-outline-width', - 'selected-pressed-outline-width' // go/keep-sorted end + 'selected-pressed-outline-width', + 'unselected-focus-state-layer-color', + 'unselected-focus-state-layer-opacity', + // go/keep-sorted end ); $_default: ( diff --git a/tokens/_md-comp-elevated-button.scss b/tokens/_md-comp-elevated-button.scss index 1c16ff6899..01e4b9027f 100644 --- a/tokens/_md-comp-elevated-button.scss +++ b/tokens/_md-comp-elevated-button.scss @@ -30,8 +30,6 @@ $supported-tokens: ( 'disabled-label-text-opacity', 'focus-container-elevation', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-container-elevation', 'hover-label-text-color', 'hover-state-layer-color', @@ -60,6 +58,8 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-fab-branded.scss b/tokens/_md-comp-fab-branded.scss index af2ae5a4e2..4ddfb51dd1 100644 --- a/tokens/_md-comp-fab-branded.scss +++ b/tokens/_md-comp-fab-branded.scss @@ -28,8 +28,6 @@ $supported-tokens: ( 'container-width', 'focus-container-elevation', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-container-elevation', 'hover-label-text-color', 'hover-state-layer-color', @@ -53,6 +51,13 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', + // go/keep-sorted end +); + @function _get-new-tokens($deps, $exclude-hardcoded-values) { $large-tokens: md-comp-fab-branded-large.values( $deps, @@ -91,6 +96,7 @@ $_default: ( $tokens: values.validate( md-comp-fab-branded.values($deps, $exclude-hardcoded-values), $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens, $new-tokens: _get-new-tokens($deps, $exclude-hardcoded-values) ); diff --git a/tokens/_md-comp-fab.scss b/tokens/_md-comp-fab.scss index e72c875c2e..4e0745f3d7 100644 --- a/tokens/_md-comp-fab.scss +++ b/tokens/_md-comp-fab.scss @@ -36,8 +36,6 @@ $supported-tokens: ( 'focus-container-elevation', 'focus-icon-color', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-container-elevation', 'hover-icon-color', 'hover-label-text-color', @@ -64,7 +62,6 @@ $supported-tokens: ( 'primary-container-color', 'primary-focus-icon-color', 'primary-focus-label-text-color', - 'primary-focus-state-layer-color', 'primary-hover-icon-color', 'primary-hover-label-text-color', 'primary-hover-state-layer-color', @@ -76,7 +73,6 @@ $supported-tokens: ( 'secondary-container-color', 'secondary-focus-icon-color', 'secondary-focus-label-text-color', - 'secondary-focus-state-layer-color', 'secondary-hover-icon-color', 'secondary-hover-label-text-color', 'secondary-hover-state-layer-color', @@ -92,7 +88,6 @@ $supported-tokens: ( 'tertiary-container-color', 'tertiary-focus-icon-color', 'tertiary-focus-label-text-color', - 'tertiary-focus-state-layer-color', 'tertiary-hover-icon-color', 'tertiary-hover-label-text-color', 'tertiary-hover-state-layer-color', @@ -104,6 +99,13 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', + // go/keep-sorted end +); + @function _get-new-tokens($deps, $exclude-hardcoded-values) { $large-tokens: md-comp-fab-surface-large.values( $deps, @@ -157,8 +159,6 @@ $supported-tokens: ( 'primary-focus-icon-color': map.get($primary-tokens, 'focus-icon-color'), 'primary-focus-label-text-color': map.get($extended-primary-tokens, 'focus-label-text-color'), - 'primary-focus-state-layer-color': - map.get($primary-tokens, 'focus-state-layer-color'), 'primary-hover-icon-color': map.get($primary-tokens, 'hover-icon-color'), 'primary-hover-label-text-color': map.get($extended-primary-tokens, 'hover-label-text-color'), @@ -176,8 +176,6 @@ $supported-tokens: ( 'secondary-focus-icon-color': map.get($secondary-tokens, 'focus-icon-color'), 'secondary-focus-label-text-color': map.get($extended-secondary-tokens, 'focus-label-text-color'), - 'secondary-focus-state-layer-color': - map.get($secondary-tokens, 'focus-state-layer-color'), 'secondary-hover-icon-color': map.get($secondary-tokens, 'hover-icon-color'), 'secondary-hover-label-text-color': map.get($extended-secondary-tokens, 'hover-label-text-color'), @@ -200,8 +198,6 @@ $supported-tokens: ( 'tertiary-focus-icon-color': map.get($tertiary-tokens, 'focus-icon-color'), 'tertiary-focus-label-text-color': map.get($extended-tertiary-tokens, 'focus-label-text-color'), - 'tertiary-focus-state-layer-color': - map.get($tertiary-tokens, 'focus-state-layer-color'), 'tertiary-hover-icon-color': map.get($tertiary-tokens, 'hover-icon-color'), 'tertiary-hover-label-text-color': map.get($extended-tertiary-tokens, 'hover-label-text-color'), @@ -234,6 +230,7 @@ $_default: ( $tokens: values.validate( $tokens, $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens, $new-tokens: _get-new-tokens($deps, $exclude-hardcoded-values) ); diff --git a/tokens/_md-comp-filled-button.scss b/tokens/_md-comp-filled-button.scss index 7eb700f2ca..e706708566 100644 --- a/tokens/_md-comp-filled-button.scss +++ b/tokens/_md-comp-filled-button.scss @@ -30,8 +30,6 @@ $supported-tokens: ( 'disabled-label-text-opacity', 'focus-container-elevation', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-container-elevation', 'hover-label-text-color', 'hover-state-layer-color', @@ -60,6 +58,8 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-filled-icon-button.scss b/tokens/_md-comp-filled-icon-button.scss index da2ba80f26..348f21ef87 100644 --- a/tokens/_md-comp-filled-icon-button.scss +++ b/tokens/_md-comp-filled-icon-button.scss @@ -21,8 +21,6 @@ $supported-tokens: ( 'disabled-icon-color', 'disabled-icon-opacity', 'focus-icon-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-icon-color', 'hover-state-layer-color', 'hover-state-layer-opacity', @@ -33,14 +31,12 @@ $supported-tokens: ( 'pressed-state-layer-opacity', 'selected-container-color', 'toggle-selected-focus-icon-color', - 'toggle-selected-focus-state-layer-color', 'toggle-selected-hover-icon-color', 'toggle-selected-hover-state-layer-color', 'toggle-selected-icon-color', 'toggle-selected-pressed-icon-color', 'toggle-selected-pressed-state-layer-color', 'toggle-unselected-focus-icon-color', - 'toggle-unselected-focus-state-layer-color', 'toggle-unselected-hover-icon-color', 'toggle-unselected-hover-state-layer-color', 'toggle-unselected-icon-color', @@ -50,6 +46,15 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', + 'toggle-selected-focus-state-layer-color', + 'toggle-unselected-focus-state-layer-color', + // go/keep-sorted end +); + $_default: ( 'md-sys-color': md-sys-color.values-light(), 'md-sys-shape': md-sys-shape.values(), @@ -59,7 +64,8 @@ $_default: ( @function values($deps: $_default, $exclude-hardcoded-values: false) { $tokens: values.validate( md-comp-filled-icon-button.values($deps, $exclude-hardcoded-values), - $supported-tokens: $supported-tokens + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens ); @return $tokens; diff --git a/tokens/_md-comp-filled-tonal-button.scss b/tokens/_md-comp-filled-tonal-button.scss index 93234dfdf1..f97c7860db 100644 --- a/tokens/_md-comp-filled-tonal-button.scss +++ b/tokens/_md-comp-filled-tonal-button.scss @@ -30,8 +30,6 @@ $supported-tokens: ( 'disabled-label-text-opacity', 'focus-container-elevation', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-container-elevation', 'hover-label-text-color', 'hover-state-layer-color', @@ -60,6 +58,8 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-filled-tonal-icon-button.scss b/tokens/_md-comp-filled-tonal-icon-button.scss index 0ba58b68b9..fff4d80033 100644 --- a/tokens/_md-comp-filled-tonal-icon-button.scss +++ b/tokens/_md-comp-filled-tonal-icon-button.scss @@ -21,8 +21,6 @@ $supported-tokens: ( 'disabled-icon-color', 'disabled-icon-opacity', 'focus-icon-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-icon-color', 'hover-state-layer-color', 'hover-state-layer-opacity', @@ -33,14 +31,12 @@ $supported-tokens: ( 'pressed-state-layer-opacity', 'selected-container-color', 'toggle-selected-focus-icon-color', - 'toggle-selected-focus-state-layer-color', 'toggle-selected-hover-icon-color', 'toggle-selected-hover-state-layer-color', 'toggle-selected-icon-color', 'toggle-selected-pressed-icon-color', 'toggle-selected-pressed-state-layer-color', 'toggle-unselected-focus-icon-color', - 'toggle-unselected-focus-state-layer-color', 'toggle-unselected-hover-icon-color', 'toggle-unselected-hover-state-layer-color', 'toggle-unselected-icon-color', @@ -50,6 +46,15 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', + 'toggle-selected-focus-state-layer-color', + 'toggle-unselected-focus-state-layer-color', + // go/keep-sorted end +); + $_default: ( 'md-sys-color': md-sys-color.values-light(), 'md-sys-shape': md-sys-shape.values(), @@ -59,7 +64,8 @@ $_default: ( @function values($deps: $_default, $exclude-hardcoded-values: false) { $tokens: values.validate( md-comp-filled-tonal-icon-button.values($deps, $exclude-hardcoded-values), - $supported-tokens: $supported-tokens + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens ); @return $tokens; diff --git a/tokens/_md-comp-filter-chip.scss b/tokens/_md-comp-filter-chip.scss index 90ffaebfed..bc2c1be52c 100644 --- a/tokens/_md-comp-filter-chip.scss +++ b/tokens/_md-comp-filter-chip.scss @@ -43,8 +43,6 @@ $supported-tokens: ( 'focus-label-text-color', 'focus-leading-icon-color', 'focus-outline-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'focus-trailing-icon-color', 'hover-label-text-color', 'hover-leading-icon-color', @@ -65,8 +63,6 @@ $supported-tokens: ( 'selected-container-color', 'selected-focus-label-text-color', 'selected-focus-leading-icon-color', - 'selected-focus-state-layer-color', - 'selected-focus-state-layer-opacity', 'selected-focus-trailing-icon-color', 'selected-hover-label-text-color', 'selected-hover-leading-icon-color', @@ -96,6 +92,8 @@ $unsupported-tokens: ( 'dragged-state-layer-opacity', 'dragged-trailing-icon-color', 'focus-container-elevation', + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'hover-container-elevation', 'label-text-font', 'label-text-line-height', @@ -109,6 +107,8 @@ $unsupported-tokens: ( 'selected-dragged-state-layer-opacity', 'selected-dragged-trailing-icon-color', 'selected-focus-container-elevation', + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', 'selected-hover-container-elevation', 'selected-pressed-container-elevation', // go/keep-sorted end diff --git a/tokens/_md-comp-icon-button.scss b/tokens/_md-comp-icon-button.scss index e7ef9731a7..e68a052879 100644 --- a/tokens/_md-comp-icon-button.scss +++ b/tokens/_md-comp-icon-button.scss @@ -17,8 +17,6 @@ $supported-tokens: ( 'disabled-icon-opacity', 'icon-size', 'selected-focus-icon-color', - 'selected-focus-state-layer-color', - 'selected-focus-state-layer-opacity', 'selected-hover-icon-color', 'selected-hover-state-layer-color', 'selected-hover-state-layer-opacity', @@ -29,8 +27,6 @@ $supported-tokens: ( 'state-layer-shape', 'state-layer-size', 'unselected-focus-icon-color', - 'unselected-focus-state-layer-color', - 'unselected-focus-state-layer-opacity', 'unselected-hover-icon-color', 'unselected-hover-state-layer-color', 'unselected-hover-state-layer-opacity', @@ -41,6 +37,15 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', + 'unselected-focus-state-layer-color', + 'unselected-focus-state-layer-opacity', + // go/keep-sorted end +); + $_default: ( 'md-sys-color': md-sys-color.values-light(), 'md-sys-shape': md-sys-shape.values(), @@ -50,7 +55,8 @@ $_default: ( @function values($deps: $_default, $exclude-hardcoded-values: false) { $tokens: values.validate( md-comp-icon-button.values($deps, $exclude-hardcoded-values), - $supported-tokens: $supported-tokens + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens ); @return $tokens; diff --git a/tokens/_md-comp-input-chip.scss b/tokens/_md-comp-input-chip.scss index 9875e350be..7682347624 100644 --- a/tokens/_md-comp-input-chip.scss +++ b/tokens/_md-comp-input-chip.scss @@ -36,8 +36,6 @@ $supported-tokens: ( 'focus-label-text-color', 'focus-leading-icon-color', 'focus-outline-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'focus-trailing-icon-color', 'hover-label-text-color', 'hover-leading-icon-color', @@ -58,8 +56,6 @@ $supported-tokens: ( 'selected-container-color', 'selected-focus-label-text-color', 'selected-focus-leading-icon-color', - 'selected-focus-state-layer-color', - 'selected-focus-state-layer-opacity', 'selected-focus-trailing-icon-color', 'selected-hover-label-text-color', 'selected-hover-leading-icon-color', @@ -88,6 +84,8 @@ $unsupported-tokens: ( 'dragged-state-layer-color', 'dragged-state-layer-opacity', 'dragged-trailing-icon-color', + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', @@ -98,6 +96,8 @@ $unsupported-tokens: ( 'selected-dragged-state-layer-color', 'selected-dragged-state-layer-opacity', 'selected-dragged-trailing-icon-color', + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', 'trailing-icon-size', // go/keep-sorted end ); diff --git a/tokens/_md-comp-list-item.scss b/tokens/_md-comp-list-item.scss index 2aee9cbf89..c73249eded 100644 --- a/tokens/_md-comp-list-item.scss +++ b/tokens/_md-comp-list-item.scss @@ -16,55 +16,6 @@ @use './values'; // go/keep-sorted end -$_default: ( - 'md-sys-color': md-sys-color.values-light(), - 'md-sys-elevation': md-sys-elevation.values(), - 'md-sys-shape': md-sys-shape.values(), - 'md-sys-state': md-sys-state.values(), - 'md-sys-typescale': md-sys-typescale.values(), -); - -$unsupported-tokens: ( - // go/keep-sorted start - 'list-item-container-elevation', - 'list-item-disabled-state-layer-color', - 'list-item-disabled-state-layer-opacity', - 'list-item-dragged-container-elevation', - 'list-item-dragged-label-text-color', - 'list-item-dragged-leading-icon-icon-color', - 'list-item-dragged-state-layer-color', - 'list-item-dragged-state-layer-opacity', - 'list-item-dragged-trailing-icon-icon-color', - 'list-item-label-text-font', - 'list-item-label-text-size', - 'list-item-label-text-tracking', - 'list-item-label-text-weight', - 'list-item-leading-avatar-label-font', - 'list-item-leading-avatar-label-line-height', - 'list-item-leading-avatar-label-size', - 'list-item-leading-avatar-label-tracking', - 'list-item-leading-avatar-label-weight', - 'list-item-overline-color', - 'list-item-overline-font', - 'list-item-overline-line-height', - 'list-item-overline-size', - 'list-item-overline-tracking', - 'list-item-overline-type', - 'list-item-overline-weight', - 'list-item-selected-trailing-icon-color', - 'list-item-supporting-text-font', - 'list-item-supporting-text-line-height', - 'list-item-supporting-text-size', - 'list-item-supporting-text-tracking', - 'list-item-supporting-text-weight', - 'list-item-trailing-supporting-text-font', - 'list-item-trailing-supporting-text-size', - 'list-item-trailing-supporting-text-tracking', - 'list-item-trailing-supporting-text-weight', - 'list-item-unselected-trailing-icon-color', - // go/keep-sorted end -); - $supported-tokens: ( // go/keep-sorted start 'list-item-container-color', @@ -77,8 +28,6 @@ $supported-tokens: ( 'list-item-disabled-trailing-icon-opacity', 'list-item-focus-label-text-color', 'list-item-focus-leading-icon-icon-color', - 'list-item-focus-state-layer-color', - 'list-item-focus-state-layer-opacity', 'list-item-focus-trailing-icon-icon-color', 'list-item-hover-label-text-color', 'list-item-hover-leading-icon-icon-color', @@ -120,7 +69,72 @@ $supported-tokens: ( // go/keep-sorted end ); -@function get-new-tokens($deps, $exclude-hardcoded-values) { +$unsupported-tokens: ( + // go/keep-sorted start + 'list-item-container-elevation', + 'list-item-disabled-state-layer-color', + 'list-item-disabled-state-layer-opacity', + 'list-item-dragged-container-elevation', + 'list-item-dragged-label-text-color', + 'list-item-dragged-leading-icon-icon-color', + 'list-item-dragged-state-layer-color', + 'list-item-dragged-state-layer-opacity', + 'list-item-dragged-trailing-icon-icon-color', + 'list-item-focus-state-layer-color', + 'list-item-focus-state-layer-opacity', + 'list-item-label-text-font', + 'list-item-label-text-size', + 'list-item-label-text-tracking', + 'list-item-label-text-weight', + 'list-item-leading-avatar-label-font', + 'list-item-leading-avatar-label-line-height', + 'list-item-leading-avatar-label-size', + 'list-item-leading-avatar-label-tracking', + 'list-item-leading-avatar-label-weight', + 'list-item-overline-color', + 'list-item-overline-font', + 'list-item-overline-line-height', + 'list-item-overline-size', + 'list-item-overline-tracking', + 'list-item-overline-type', + 'list-item-overline-weight', + 'list-item-selected-trailing-icon-color', + 'list-item-supporting-text-font', + 'list-item-supporting-text-line-height', + 'list-item-supporting-text-size', + 'list-item-supporting-text-tracking', + 'list-item-supporting-text-weight', + 'list-item-trailing-supporting-text-font', + 'list-item-trailing-supporting-text-size', + 'list-item-trailing-supporting-text-tracking', + 'list-item-trailing-supporting-text-weight', + 'list-item-unselected-trailing-icon-color', + // go/keep-sorted end +); + +$_default: ( + 'md-sys-color': md-sys-color.values-light(), + 'md-sys-elevation': md-sys-elevation.values(), + '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) { + $original-tokens: md-comp-list.values($deps, $exclude-hardcoded-values); + $original-tokens: map.merge($original-tokens, _get-override-tokens($deps)); + + $tokens: values.validate( + $original-tokens, + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens, + $new-tokens: _get-new-tokens($deps, $exclude-hardcoded-values) + ); + + @return $tokens; +} + +@function _get-new-tokens($deps, $exclude-hardcoded-values) { // Values pulled from b/198759625 spreadsheet @return ( // go/keep-sorted start @@ -141,7 +155,7 @@ $supported-tokens: ( ); } -@function get-override-tokens($deps) { +@function _get-override-tokens($deps) { // TODO(b/271876162): remove when tokens compiler emits typescale tokens @return ( // go/keep-sorted start @@ -158,17 +172,3 @@ $supported-tokens: ( // go/keep-sorted end ); } - -@function values($deps: $_default, $exclude-hardcoded-values: false) { - $original-tokens: md-comp-list.values($deps, $exclude-hardcoded-values); - $original-tokens: map.merge($original-tokens, get-override-tokens($deps)); - - $tokens: values.validate( - $original-tokens, - $supported-tokens: $supported-tokens, - $unsupported-tokens: $unsupported-tokens, - $new-tokens: get-new-tokens($deps, $exclude-hardcoded-values) - ); - - @return $tokens; -} diff --git a/tokens/_md-comp-list.scss b/tokens/_md-comp-list.scss index 3e2c3f1f1a..64ab25a08a 100644 --- a/tokens/_md-comp-list.scss +++ b/tokens/_md-comp-list.scss @@ -16,16 +16,12 @@ @use './values'; // go/keep-sorted end -$_default: ( - 'md-sys-color': md-sys-color.values-light(), - 'md-sys-elevation': md-sys-elevation.values(), - 'md-sys-shape': md-sys-shape.values(), - 'md-sys-state': md-sys-state.values(), - 'md-sys-typescale': md-sys-typescale.values(), +$supported-tokens: ( + // go/keep-sorted start + 'container-color', + // go/keep-sorted end ); -$supported-tokens: (); - $unsupported-tokens: ( // go/keep-sorted start 'list-item-container-elevation', @@ -116,6 +112,14 @@ $unsupported-tokens: ( // go/keep-sorted end ); +$_default: ( + 'md-sys-color': md-sys-color.values-light(), + 'md-sys-elevation': md-sys-elevation.values(), + '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-list.values($deps, $exclude-hardcoded-values), diff --git a/tokens/_md-comp-menu-item.scss b/tokens/_md-comp-menu-item.scss index 7c0bb8cb59..4bc5d7eaf6 100644 --- a/tokens/_md-comp-menu-item.scss +++ b/tokens/_md-comp-menu-item.scss @@ -16,10 +16,10 @@ @use './values'; // go/keep-sorted end -$_default: ( - 'md-sys-color': md-sys-color.values-light(), - 'md-sys-elevation': md-sys-elevation.values(), - 'md-sys-shape': md-sys-shape.values(), +$supported-tokens: ( + // go/keep-sorted start + 'list-item-selected-container-color', + // go/keep-sorted end ); $unsupported-tokens: ( @@ -30,10 +30,10 @@ $unsupported-tokens: ( // go/keep-sorted end ); -$supported-tokens: ( - // go/keep-sorted start - 'list-item-selected-container-color', - // go/keep-sorted end +$_default: ( + 'md-sys-color': md-sys-color.values-light(), + 'md-sys-elevation': md-sys-elevation.values(), + 'md-sys-shape': md-sys-shape.values(), ); @function values($deps: $_default, $exclude-hardcoded-values: false) { diff --git a/tokens/_md-comp-menu.scss b/tokens/_md-comp-menu.scss index 659c2b8903..b77b91dc55 100644 --- a/tokens/_md-comp-menu.scss +++ b/tokens/_md-comp-menu.scss @@ -16,10 +16,13 @@ @use './values'; // go/keep-sorted end -$_default: ( - 'md-sys-color': md-sys-color.values-light(), - 'md-sys-elevation': md-sys-elevation.values(), - 'md-sys-shape': md-sys-shape.values(), +$supported-tokens: ( + // go/keep-sorted start + 'container-color', + 'container-elevation', + 'container-shadow-color', + 'container-shape', + // go/keep-sorted end ); $unsupported-tokens: ( @@ -28,13 +31,10 @@ $unsupported-tokens: ( // go/keep-sorted end ); -$supported-tokens: ( - // go/keep-sorted start - 'container-color', - 'container-elevation', - 'container-shadow-color', - 'container-shape', - // go/keep-sorted end +$_default: ( + 'md-sys-color': md-sys-color.values-light(), + 'md-sys-elevation': md-sys-elevation.values(), + 'md-sys-shape': md-sys-shape.values(), ); @function values($deps: $_default, $exclude-hardcoded-values: false) { diff --git a/tokens/_md-comp-outlined-button.scss b/tokens/_md-comp-outlined-button.scss index 0f321ae607..d51c62ef6b 100644 --- a/tokens/_md-comp-outlined-button.scss +++ b/tokens/_md-comp-outlined-button.scss @@ -25,8 +25,6 @@ $supported-tokens: ( 'disabled-outline-opacity', 'focus-label-text-color', 'focus-outline-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-label-text-color', 'hover-outline-color', 'hover-state-layer-color', @@ -57,6 +55,8 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-outlined-icon-button.scss b/tokens/_md-comp-outlined-icon-button.scss index bda662d4d5..5f7a02fc9d 100644 --- a/tokens/_md-comp-outlined-icon-button.scss +++ b/tokens/_md-comp-outlined-icon-button.scss @@ -21,20 +21,17 @@ $supported-tokens: ( 'disabled-selected-container-opacity', 'disabled-unselected-outline-color', 'disabled-unselected-outline-opacity', - 'focus-state-layer-opacity', 'hover-state-layer-opacity', 'icon-size', 'pressed-state-layer-opacity', 'selected-container-color', 'selected-focus-icon-color', - 'selected-focus-state-layer-color', 'selected-hover-icon-color', 'selected-hover-state-layer-color', 'selected-icon-color', 'selected-pressed-icon-color', 'selected-pressed-state-layer-color', 'unselected-focus-icon-color', - 'unselected-focus-state-layer-color', 'unselected-hover-icon-color', 'unselected-hover-state-layer-color', 'unselected-icon-color', @@ -45,6 +42,14 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'focus-state-layer-opacity', + 'selected-focus-state-layer-color', + 'unselected-focus-state-layer-color', + // go/keep-sorted end +); + $_default: ( 'md-sys-color': md-sys-color.values-light(), 'md-sys-shape': md-sys-shape.values(), @@ -54,7 +59,8 @@ $_default: ( @function values($deps: $_default, $exclude-hardcoded-values: false) { $tokens: values.validate( md-comp-outlined-icon-button.values($deps, $exclude-hardcoded-values), - $supported-tokens: $supported-tokens + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens ); @return $tokens; diff --git a/tokens/_md-comp-radio-button.scss b/tokens/_md-comp-radio-button.scss index 3229fda96a..0a9eb67373 100644 --- a/tokens/_md-comp-radio-button.scss +++ b/tokens/_md-comp-radio-button.scss @@ -7,13 +7,56 @@ @use './md-sys-color'; @use './md-sys-state'; @use './v0_172/md-comp-radio-button'; +@use './values'; // go/keep-sorted end +$supported-tokens: ( + // go/keep-sorted start + 'disabled-selected-icon-color', + 'disabled-selected-icon-opacity', + 'disabled-unselected-icon-color', + 'disabled-unselected-icon-opacity', + 'icon-size', + 'selected-focus-icon-color', + 'selected-hover-icon-color', + 'selected-hover-state-layer-color', + 'selected-hover-state-layer-opacity', + 'selected-icon-color', + 'selected-pressed-icon-color', + 'selected-pressed-state-layer-color', + 'selected-pressed-state-layer-opacity', + 'state-layer-size', + 'unselected-focus-icon-color', + 'unselected-hover-icon-color', + 'unselected-hover-state-layer-color', + 'unselected-hover-state-layer-opacity', + 'unselected-icon-color', + 'unselected-pressed-icon-color', + 'unselected-pressed-state-layer-color', + 'unselected-pressed-state-layer-opacity', + // go/keep-sorted end +); + +$unsupported-tokens: ( + // go/keep-sorted start + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', + 'unselected-focus-state-layer-color', + 'unselected-focus-state-layer-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-hardcoded-values: false) { - @return md-comp-radio-button.values($deps, $exclude-hardcoded-values); + $tokens: values.validate( + md-comp-radio-button.values($deps, $exclude-hardcoded-values), + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens + ); + + @return $tokens; } diff --git a/tokens/_md-comp-ripple.scss b/tokens/_md-comp-ripple.scss index 542af4dfd1..dadc9baae8 100644 --- a/tokens/_md-comp-ripple.scss +++ b/tokens/_md-comp-ripple.scss @@ -15,8 +15,6 @@ $supported-tokens: ( // go/keep-sorted start - 'focus-color', - 'focus-opacity', 'hover-color', 'hover-opacity', 'pressed-color', @@ -31,8 +29,6 @@ $_default: ( @function values($deps: $_default) { $tokens: ( - 'focus-color': map.get($deps, 'md-sys-color', 'on-surface'), - 'focus-opacity': map.get($deps, 'md-sys-state', 'focus-state-layer-opacity'), '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'), diff --git a/tokens/_md-comp-suggestion-chip.scss b/tokens/_md-comp-suggestion-chip.scss index 9ef2fb371f..c5c9367724 100644 --- a/tokens/_md-comp-suggestion-chip.scss +++ b/tokens/_md-comp-suggestion-chip.scss @@ -37,8 +37,6 @@ $supported-tokens: ( 'focus-label-text-color', 'focus-leading-icon-color', 'focus-outline-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-label-text-color', 'hover-leading-icon-color', 'hover-state-layer-color', @@ -64,6 +62,8 @@ $unsupported-tokens: ( 'dragged-leading-icon-color', 'dragged-state-layer-color', 'dragged-state-layer-opacity', + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size', diff --git a/tokens/_md-comp-switch.scss b/tokens/_md-comp-switch.scss index 0525bf31c0..8e074e33cd 100644 --- a/tokens/_md-comp-switch.scss +++ b/tokens/_md-comp-switch.scss @@ -30,8 +30,6 @@ $supported-tokens: ( 'pressed-handle-width', 'selected-focus-handle-color', 'selected-focus-icon-color', - 'selected-focus-state-layer-color', - 'selected-focus-state-layer-opacity', 'selected-focus-track-color', 'selected-handle-color', 'selected-handle-height', @@ -57,8 +55,6 @@ $supported-tokens: ( 'track-width', 'unselected-focus-handle-color', 'unselected-focus-icon-color', - 'unselected-focus-state-layer-color', - 'unselected-focus-state-layer-opacity', 'unselected-focus-track-color', 'unselected-focus-track-outline-color', 'unselected-handle-color', @@ -85,6 +81,15 @@ $supported-tokens: ( // go/keep-sorted end ); +$unsupported-tokens: ( + // go/keep-sorted start + 'selected-focus-state-layer-color', + 'selected-focus-state-layer-opacity', + 'unselected-focus-state-layer-color', + 'unselected-focus-state-layer-opacity', + // go/keep-sorted end +); + $_default: ( 'md-sys-color': md-sys-color.values-light(), 'md-sys-shape': md-sys-shape.values(), @@ -94,7 +99,8 @@ $_default: ( @function values($deps: $_default, $exclude-hardcoded-values: false) { $tokens: values.validate( md-comp-switch.values($deps, $exclude-hardcoded-values), - $supported-tokens: $supported-tokens + $supported-tokens: $supported-tokens, + $unsupported-tokens: $unsupported-tokens ); @return $tokens; diff --git a/tokens/_md-comp-tab.scss b/tokens/_md-comp-tab.scss index 18b0d334ae..546b643dff 100644 --- a/tokens/_md-comp-tab.scss +++ b/tokens/_md-comp-tab.scss @@ -30,8 +30,6 @@ $supported-tokens: ( // go/keep-sorted start 'primary-tab-active-focus-icon-color', 'primary-tab-active-focus-label-text-color', - 'primary-tab-active-focus-state-layer-color', - 'primary-tab-active-focus-state-layer-opacity', 'primary-tab-active-hover-icon-color', 'primary-tab-active-hover-label-text-color', 'primary-tab-active-hover-state-layer-color', @@ -53,8 +51,6 @@ $supported-tokens: ( 'primary-tab-divider-thickness', 'primary-tab-focus-icon-color', 'primary-tab-focus-label-text-color', - 'primary-tab-focus-state-layer-color', - 'primary-tab-focus-state-layer-opacity', 'primary-tab-hover-icon-color', 'primary-tab-hover-label-text-color', 'primary-tab-hover-state-layer-color', @@ -69,8 +65,6 @@ $supported-tokens: ( 'primary-tab-pressed-state-layer-opacity', 'secondary-tab-active-focus-icon-color', 'secondary-tab-active-focus-label-text-color', - 'secondary-tab-active-focus-state-layer-color', - 'secondary-tab-active-focus-state-layer-opacity', 'secondary-tab-active-hover-icon-color', 'secondary-tab-active-hover-label-text-color', 'secondary-tab-active-hover-state-layer-color', @@ -92,8 +86,6 @@ $supported-tokens: ( 'secondary-tab-divider-thickness', 'secondary-tab-focus-icon-color', 'secondary-tab-focus-label-text-color', - 'secondary-tab-focus-state-layer-color', - 'secondary-tab-focus-state-layer-opacity', 'secondary-tab-hover-icon-color', 'secondary-tab-hover-label-text-color', 'secondary-tab-hover-state-layer-color', @@ -123,7 +115,13 @@ $unsupported-tokens: ( 'secondary-tab-label-text-line-height', 'secondary-tab-label-text-size', 'secondary-tab-label-text-tracking', - 'secondary-tab-label-text-weight' + 'secondary-tab-label-text-weight', + 'primary-tab-active-focus-state-layer-color', + 'primary-tab-active-focus-state-layer-opacity', + 'primary-tab-focus-state-layer-color', + 'primary-tab-focus-state-layer-opacity', + 'secondary-tab-focus-state-layer-color', + 'secondary-tab-focus-state-layer-opacity' ); // Note, this combines the raw primary and secondary tab variant tokens @@ -265,10 +263,6 @@ $unsupported-tokens: ( 'active-focus-icon-color': map.get($tokens, 'icon-color'), 'active-focus-label-text-color': map.get($tokens, 'active-label-text-color'), - 'active-focus-state-layer-color': - map.get($tokens, 'focus-state-layer-color'), - 'active-focus-state-layer-opacity': - map.get($tokens, 'focus-state-layer-opacity'), 'active-hover-icon-color': map.get($tokens, 'icon-color'), 'active-hover-label-text-color': map.get($tokens, 'active-label-text-color'), diff --git a/tokens/_md-comp-text-button.scss b/tokens/_md-comp-text-button.scss index aa17f26546..7ac105cb88 100644 --- a/tokens/_md-comp-text-button.scss +++ b/tokens/_md-comp-text-button.scss @@ -22,8 +22,6 @@ $supported-tokens: ( 'disabled-label-text-color', 'disabled-label-text-opacity', 'focus-label-text-color', - 'focus-state-layer-color', - 'focus-state-layer-opacity', 'hover-label-text-color', 'hover-state-layer-color', 'hover-state-layer-opacity', @@ -50,6 +48,8 @@ $supported-tokens: ( $unsupported-tokens: ( // go/keep-sorted start + 'focus-state-layer-color', + 'focus-state-layer-opacity', 'label-text-font', 'label-text-line-height', 'label-text-size',