diff --git a/src/components/radio-button/radio-button.css b/src/components/radio-button/radio-button.css index 8b1267082..47b93cb80 100644 --- a/src/components/radio-button/radio-button.css +++ b/src/components/radio-button/radio-button.css @@ -34,14 +34,12 @@ */ :host([checked]) { - --background-color: var(--wa-color-brand-fill-quiet); - --background-color-hover: var(--background-color); - --border-color: var(--wa-form-control-activated-color); - --text-color: var(--wa-color-brand-on-normal); - --indicator-color: var(--border-color); + --indicator-color: var(--wa-form-control-activated-color); --indicator-width: var(--wa-border-width-s); - box-shadow: - var(--box-shadow, 0 0 transparent), - inset 0 0 0 var(--indicator-width) var(--indicator-color); + box-shadow: inset 0 0 0 var(--indicator-width) var(--indicator-color); + + & button { + --border-color: var(--indicator-color); + } } diff --git a/src/components/radio-button/radio-button.ts b/src/components/radio-button/radio-button.ts index 03240230f..fbbabe866 100644 --- a/src/components/radio-button/radio-button.ts +++ b/src/components/radio-button/radio-button.ts @@ -8,6 +8,7 @@ import { HasSlotController } from '../../internal/slot.js'; import { watch } from '../../internal/watch.js'; import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-formassociated-element.js'; import nativeStyles from '../../styles/native/button.css'; +import appearanceStyles from '../../styles/utilities/appearance.css'; import sizeStyles from '../../styles/utilities/size.css'; import variantStyles from '../../styles/utilities/variants.css'; import buttonStyles from '../button/button.css'; @@ -50,7 +51,7 @@ import styles from './radio-button.css'; */ @customElement('wa-radio-button') export default class WaRadioButton extends WebAwesomeFormAssociatedElement { - static shadowStyle = [variantStyles, sizeStyles, nativeStyles, buttonStyles, styles]; + static shadowStyle = [variantStyles, appearanceStyles, sizeStyles, nativeStyles, buttonStyles, styles]; private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix'); diff --git a/src/styles/themes/awesome.css b/src/styles/themes/awesome.css index 45a48794e..0d3fd59b1 100644 --- a/src/styles/themes/awesome.css +++ b/src/styles/themes/awesome.css @@ -247,10 +247,13 @@ wa-badge { text-transform: uppercase; } -:is(button, input:where([type='button'], [type='reset'], [type='submit']), wa-button, .wa-button):not( - [appearance='plain'], - .wa-plain - ) { +:is( + button, + input:where([type='button'], [type='reset'], [type='submit']), + wa-button, + wa-radio-group > wa-radio-button, + .wa-button + ):not([appearance='plain'], .wa-plain) { --wa-transition-slow: 0; --wa-transition-normal: 0; --wa-transition-fast: 0; @@ -269,7 +272,8 @@ wa-badge { --background-color: var(--wa-color-surface-default); } - &:not([disabled], [loading]):active { + &:not([disabled], [loading]):active, + &::part(checked) { box-shadow: none; transform: translateY(var(--wa-shadow-offset-y-s)); } @@ -308,18 +312,12 @@ wa-checkbox { } wa-radio-group > wa-radio-button { - --background-color-active: var(--border-color); - --border-color-active: var(--background-color-active); - --box-shadow: var(--wa-shadow-offset-x-s) var(--wa-shadow-offset-y-s) var(--wa-shadow-blur-s) var(--border-color); - --label-color-active: var(--wa-color-surface-default); - - &:active, - &[checked] { + &::part(base):active, + &::part(checked) { --background-color: var(--border-color); + --background-color-hover: var(--border-color); --border-color: var(--wa-color-neutral-border-loud); - --box-shadow: none; - --label-color: var(--wa-color-surface-default); - transform: translate(var(--wa-shadow-offset-x-s), var(--wa-shadow-offset-y-s)); + --text-color: var(--wa-color-surface-default); } }