/* * : M3's radio buttons (resources/views/components/radio.blade.php), on the row the * selection controls share (components/selection.css). * * RadioButtonTokens (androidx Compose Material 3, Apache-2.0): a 20px ring with a 2px * on-surface-variant outline, primary once chosen, and a 10px primary dot that grows in on the fast * spatial spring; the state layer a 40px circle around it. With the server's error the ring and * the dot are error. Disabled, both are on-surface at 38%. * * [data-md-radio-button] the ring: input, [data-md-radio-dot] */ @layer material.reset, material.tokens, material.base, material.layout, material.components, material.text, material.visibility; @import './selection.css'; @layer material.components { [data-md-radio-button] { position: relative; display: grid; flex: none; place-items: center; width: 20px; height: 20px; } [data-md-radio-button] > * { grid-area: 1 / 1; } [data-md-radio-button]::before { inset: -10px; } [data-md-radio-button]:has(input:focus-visible)::before { outline: 3px solid var(--md-sys-color-secondary); } [data-md-radio-button] input { width: 20px; height: 20px; border: 2px solid var(--md-sys-color-on-surface-variant); border-radius: var(--md-sys-shape-corner-full); } [data-md-radio-button] [data-md-radio-dot] { width: 10px; height: 10px; border-radius: var(--md-sys-shape-corner-full); background-color: var(--md-sys-color-primary); scale: 0; pointer-events: none; transition: scale var(--md-sys-motion-spatial-fast-duration) var(--md-sys-motion-spatial-fast); } [data-md-radio-button] input:checked { border-color: var(--md-sys-color-primary); } [data-md-radio-button] input:checked ~ [data-md-radio-dot] { scale: 1; } [data-md-selection-row][data-md-invalid] [data-md-radio-button] input { border-color: var(--md-sys-color-error); } [data-md-selection-row][data-md-invalid] [data-md-radio-button] [data-md-radio-dot] { background-color: var(--md-sys-color-error); } [data-md-radio-button] input:disabled { border-color: color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity) * 100%), transparent); } [data-md-radio-button] input:disabled ~ [data-md-radio-dot] { background-color: color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity) * 100%), transparent); } }