diff --git a/src/components/checkbox/checkbox.css b/src/components/checkbox/checkbox.css index e1841b7be..2b138730a 100644 --- a/src/components/checkbox/checkbox.css +++ b/src/components/checkbox/checkbox.css @@ -16,28 +16,13 @@ display: inline-block; } -:host([size='small']) { - font-size: var(--wa-font-size-s); -} - -:host([size='medium']), -:host(:not([size])) { - font-size: var(--wa-font-size-m); -} - -:host([size='large']) { - font-size: var(--wa-font-size-l); -} - [part~='base'] { position: relative; display: flex; align-items: flex-start; - font: inherit; color: var(--wa-form-control-value-color); vertical-align: middle; cursor: pointer; - font-size: inherit; /* Disabled */ &:has(input:disabled) { @@ -90,12 +75,12 @@ input { position: absolute; - opacity: 0; padding: 0; margin: 0; - pointer-events: none; height: 100%; width: 100%; + opacity: 0; + pointer-events: none; } [part~='icon'] { diff --git a/src/components/checkbox/checkbox.ts b/src/components/checkbox/checkbox.ts index 93f5db64d..dcd28bbf4 100644 --- a/src/components/checkbox/checkbox.ts +++ b/src/components/checkbox/checkbox.ts @@ -13,6 +13,7 @@ import { WaInputEvent } from '../../events/input.js'; import { watch } from '../../internal/watch.js'; import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-element.js'; import formControlStyles from '../../styles/shadow/form-control.css'; +import sizeStyles from '../../styles/shadow/size.css'; import styles from './checkbox.css'; import type { PropertyValues } from 'lit'; @@ -55,7 +56,7 @@ import type { PropertyValues } from 'lit'; */ @customElement('wa-checkbox') export default class WaCheckbox extends WebAwesomeFormAssociatedElement { - static shadowStyle = [formControlStyles, styles]; + static shadowStyle = [formControlStyles, sizeStyles, styles]; static shadowRootOptions = { ...WebAwesomeFormAssociatedElement.shadowRootOptions, delegatesFocus: true }; @@ -221,11 +222,8 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement { return html`