UNPKG

@rhds/elements

Version:

Red Hat Design System Elements

83 lines (69 loc) 1.57 kB
:host { display: inline-flex; position: relative; } * { box-sizing: border-box; } #container { display: contents; --thumb-color: var(--rh-color-interactive-primary-default); } .darkest { --c: var(--rh-color-surface-darkest, #151515); } .darker { --c: var(--rh-color-surface-darker, #1f1f1f); } .dark { --c: var(--rh-color-surface-dark, #383838); } .light { --c: var(--rh-color-surface-light, #e0e0e0); } .lighter { --c: var(--rh-color-surface-lighter, #f2f2f2); } .lightest { --c: var(--rh-color-surface-lightest, #ffffff); } :is(.dark, .darker, .darkest) { --alt-color: var(--rh-color-surface-light, #e0e0e0); } :is(.light, .lighter, .lightest) { --alt-color: var(--rh-color-surface-dark, #383838); } :is(:focus,:hover) { --alt-color: var(--thumb-color); } input { appearance: none; display: block; position: relative; width: var(--rh-size-icon-03, 32px); height: var(--rh-size-icon-03, 32px); border-radius: 50%; margin-block: 8px; margin-inline: 4px; } input:before { display: block; content: ''; background: var(--c); border-radius: 50%; position: absolute; inset: 0; outline: var(--alt-color) solid 2px; } input:checked:after { display: block; content: ''; background: var(--alt-color); border-radius: 50%; position: absolute; inset: 6px; } input:focus { outline: var(--thumb-color) solid 4px; } label, rh-tooltip span { text-transform: capitalize; } .visually-hidden { position: fixed; top: 0; left: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }