// Auto-generated by: pnpm test:stylesheets:update import { join } from 'node:path'; import { compileLessWithTokens } from '../../../../scripts/testStylesheets/compileLessWithTokens'; import { DEFAULT_LESS_PRELUDES, DEFAULT_TOKEN_CSS_FILES } from '../../../../scripts/testStylesheets/config'; describe('components/Inputs/Switch/Switch.less stylesheet snapshot', () => { it('compiled CSS with tokens inlined', async () => { const css = await compileLessWithTokens(join(__dirname, 'Switch.less'), DEFAULT_TOKEN_CSS_FILES, { lessPreludes: DEFAULT_LESS_PRELUDES, }); expect(css).toMatchTokensInlineSnapshot(` input[type='checkbox'].switch { position: relative; width: 36px; height: 20px; opacity: 1; background-color: oklch(1 0 none); border: 1px solid oklch(0.8761 0 none); border-radius: 16px; transition: background-color 0.2s ease-in-out, left 0.2s ease-in-out; } input[type='checkbox'].switch::before { content: '' !important; } input[type='checkbox'].switch::after { content: ''; position: absolute; top: 1px; left: 1px; display: block; width: 16px; height: 16px; opacity: 1; background-color: oklch(0.7247 0.1478 233.0429); border-radius: 16px; box-shadow: 0 1px 2px oklch(0.325 0 none / 0.1); transition: all 0.2s ease-in-out; } input[type='checkbox'].switch:hover:not(:disabled)::after { background-color: oklch(0.6489 0.1344 233.2251); } input[type='checkbox'].switch:checked { background-color: oklch(0.7247 0.1478 233.0429); } input[type='checkbox'].switch:checked::after { left: calc(16px + 1px); background-color: oklch(1 0 none); } input[type='checkbox'].switch:checked:hover:not(:disabled) { background-color: oklch(0.6489 0.1344 233.2251); } input[type='checkbox'].switch:checked:hover:not(:disabled)::after { background-color: oklch(0.8761 0 none); } input[type='checkbox'].switch:disabled { opacity: 0.6; } input[type='checkbox'].switch.warning-field, input[type='checkbox'].switch.warning-field:focus { border-color: oklch(0.7251 0.1625 65.1153); } input[type='checkbox'].switch.error-field, input[type='checkbox'].switch.error-field:focus { border-color: oklch(0.5999 0.246 28.9803); } input[type='checkbox'].switch--sm { width: 28px; height: 16px; } input[type='checkbox'].switch--sm::after { left: 1px; width: 12px; height: 12px; } input[type='checkbox'].switch--sm:checked::after { left: 13px; } `); }); });