diff --git a/src/form/checkbox-item.wc b/src/form/checkbox-item.wc index d732b3d..b3182ed 100644 --- a/src/form/checkbox-item.wc +++ b/src/form/checkbox-item.wc @@ -1,6 +1,6 @@ @@ -24,16 +24,113 @@ user-select: none; white-space: nowrap; cursor: inherit; + outline: none; color: var(--color-dark-1); + + &.checked .dot { + background: var(--color-dark-1); + + wc-icon { + --size: 14px; + } + } } .dot { - --size: 20px; - padding: 2px; + display: flex; + justify-content: center; + align-items: center; + width: 16px; + height: 16px; margin-right: 4px; + border: 1px solid var(--color-dark-1); + border-radius: 4px; + background: #fff; + color: #fff; + transition: box-shadow 0.15s linear, background 0.15s linear; + + wc-icon { + --size: 0px; + transition: width 0.15s linear; + } } } +:host(:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-plain-a); +} + +:host([type='danger']) label { + color: var(--color-red-1); + .dot { + border-color: var(--color-red-1); + } + + &.checked .dot { + background: var(--color-red-1); + } +} +:host([type='danger']:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-red-a); +} + +:host([type='info']) label { + color: var(--color-blue-1); + .dot { + border-color: var(--color-bule-1); + } + + &.checked .dot { + background: var(--color-bule-1); + } +} +:host([type='info']:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-blue-a); +} + +:host([type='success']) label { + color: var(--color-green-1); + .dot { + border-color: var(--color-green-1); + } + + &.checked .dot { + background: var(--color-green-1); + } +} +:host([type='success']:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-green-a); +} + +:host([type='primary']) label { + color: var(--color-teal-1); + + .dot { + border-color: var(--color-teal-1); + } + + &.checked .dot { + background: var(--color-teal-1); + } +} +:host([type='primary']:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-teal-a); +} + +:host([type='warning']) label { + color: var(--color-orange-1); + .dot { + border-color: var(--color-orange-1); + } + + &.checked .dot { + background: var(--color-orange-1); + } +} +:host([type='warning']:focus-within) .dot { + box-shadow: 0 0 0 2px var(--color-orange-a); +} + :host([readonly]) { cursor: default; opacity: 0.8; @@ -47,26 +144,6 @@ color: var(--color-grey-2); } } - -:host([type='danger']) label { - color: var(--color-red-1); -} - -:host([type='info']) label { - color: var(--color-blue-1); -} - -:host([type='success']) label { - color: var(--color-green-1); -} - -:host([type='primary']) label { - color: var(--color-teal-1); -} - -:host([type='warning']) label { - color: var(--color-orange-1); -}