// 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/Button/Button.less stylesheet snapshot', () => { it('compiled CSS with tokens inlined', async () => { const css = await compileLessWithTokens(join(__dirname, 'Button.less'), DEFAULT_TOKEN_CSS_FILES, { lessPreludes: DEFAULT_LESS_PRELUDES, }); expect(css).toMatchTokensInlineSnapshot(` .btn { --transitionDuration: 300ms; cursor: pointer; user-select: none; position: relative; display: inline-flex; gap: 8px; align-items: center; justify-content: center; margin: 0; text-align: center; vertical-align: middle; appearance: none; border-color: transparent; border-style: solid; border-width: 1px; border-radius: 0px; transition-timing-function: ease-out; transition-duration: var(--transitionDuration); transition-property: background-color, border-color, color; } .btn > .btn--content { display: inherit; gap: inherit; align-items: inherit; justify-content: inherit; transition: opacity var(--transitionDuration) ease-out; } .btn > .loader { position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; } @media (prefers-reduced-motion: reduce) { .btn { --transitionDuration: 0ms; } } .btn--isLoading > .btn--content { opacity: 0; } .btn:hover { text-decoration: none; } .btn-lg { padding: calc(12px - 1px); font-family: 'Inter', 'Arial', sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; letter-spacing: 0.4px; } .btn-lg::before { font-size: 24px; } .btn-md { padding: calc(4px - 1px) calc(12px - 1px); font-family: 'Inter', 'Arial', sans-serif; font-size: 12px; font-weight: 400; line-height: 24px; letter-spacing: 0.4px; } .btn-md::before { font-size: 24px; } .btn-sm { padding: 4px calc(8px - 1px); font-family: 'Inter', 'Arial', sans-serif; font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: 0.4px; } .btn-sm::before { font-size: 16px; } .btn-min { min-width: 52px; margin: 2px; } .btn-fullsize { padding-right: 0; padding-left: 0; } .btn-md.btn--iconLeft { padding-left: calc(8px - 1px); } .btn-md.btn--iconRight { padding-right: calc(8px - 1px); } .btn-md.btn-combobox, .btn-lg.btn-combobox { padding-left: 25px; } .btn-primary { color: oklch(1 0 none) !important; background-color: oklch(0.7247 0.1478 233.0429); } .btn-primary:hover { color: oklch(0.5761 0 none) !important; background-color: oklch(0.6489 0.1344 233.2251); } .btn-primary:disabled, .btn-primary.disabled, .btn-primary[disabled], .btn-primary.btn-disabled, .btn-primary:disabled:hover, .btn-primary.disabled:hover, .btn-primary.btn-disabled:hover { background-color: oklch(0.6764 0 none); } .btn-action { color: oklch(1 0 none) !important; background-color: oklch(0.7257 0.1702 129.1931); } .btn-action:hover { background-color: oklch(0.6492 0.1652 128.9102); } .btn-action:disabled, .btn-action.disabled, .btn-action.btn-disabled, .btn-action:disabled:hover, .btn-action.disabled:hover, .btn-action.btn-disabled:hover { background-color: oklch(0.6764 0 none); } .btn-secondary { color: oklch(0 0 none) !important; background-color: oklch(1 0 none); border-color: oklch(0.5999 0 none); } .btn-secondary:hover { color: oklch(0.4239 0 none) !important; border-color: oklch(0.4239 0 none); } .btn-secondary:disabled, .btn-secondary.disabled, .btn-secondary.btn-disabled, .btn-secondary:disabled:hover, .btn-secondary.disabled:hover, .btn-secondary.btn-disabled:hover { color: oklch(1 0 none) !important; background-color: oklch(0.6764 0 none); border-color: oklch(0.5999 0 none); } .btn-secondary:active { border-color: oklch(0.7247 0.1478 233.0429); } .btn-destructive { color: oklch(1 0 none) !important; background-color: oklch(0.5752 0.2359 29.018); } .btn-destructive:hover { background-color: oklch(0.525 0.2153 29.0445); } .btn-destructive:disabled, .btn-destructive.disabled, .btn-destructive.btn-disabled, .btn-destructive:disabled:hover, .btn-destructive.disabled:hover, .btn-destructive.btn-disabled:hover { background-color: oklch(0.6764 0 none); } .btn:disabled, .btn.disabled, .btn.disabled:hover, .btn.btn-disabled, .btn.btn-disabled:hover { pointer-events: none; cursor: default; } .btn.disabled:focus, .btn.btn-disabled:focus, .btn:disabled:focus { outline: none; } `); }); });