// 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/Modal/Modal.less stylesheet snapshot', () => { it('compiled CSS with tokens inlined', async () => { const css = await compileLessWithTokens(join(__dirname, 'Modal.less'), DEFAULT_TOKEN_CSS_FILES, { lessPreludes: DEFAULT_LESS_PRELUDES, }); expect(css).toMatchTokensInlineSnapshot(` body:has(.modal) { overflow: hidden; } .modal { position: fixed; z-index: 11000; top: 0; left: 0; overflow: auto; width: 100%; height: 100%; /* The #modal-in wrapper below is there only because of the old css. * Also the #modal-controller-name and #h1-modal ids. * It should be removed after the admin redesign. */ } .modal iframe { display: block; margin: 0; padding: 0; background-color: oklch(1 0 none); border: 0; } .modal .std-table { margin: 0; } .modal #modal-in { padding: 0; } .modal #modal-controller-name { top: 20px; left: 40px; padding-left: 0; } .modal #h1-modal { margin-bottom: 8px; padding-right: 24px; } .modal__overlay { position: fixed; z-index: 0; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; background-color: oklch(0 0 none / 0.6); transition: opacity 0.3s ease; } .modal__overlay.modal__overlay--open { animation: fadeIn 0.3s ease forwards; } .modal__overlay.modal__overlay--closing { animation: fadeOut 0.3s ease forwards; } .modal__wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; padding: 30px 14px; } .modal__inner { position: relative; flex-basis: auto; align-self: stretch; min-width: min(100%, 560px); max-width: 100%; margin-right: auto; margin-left: auto; opacity: 0; transition: opacity 0.3s ease; } .modal__inner.modal__inner--open { animation: fadeIn 0.3s ease forwards; } .modal__inner.modal__inner--closing { animation: fadeOut 0.3s ease forwards; } .modal__inner--maxWidth { max-width: calc(600px + 2 * 12px); } .modal__inner--maxWidthHug { max-width: max-content; } .modal__inner--maxWidthFull { max-width: unset; margin-right: unset; margin-left: unset; } .modal__body { width: 100%; height: 100%; background: oklch(1 0 none); border: 12px solid oklch(0.7162 0.1452 233.2659 / 0.4); border-radius: 24px; } .modal__body.modalSmarty { padding: 24px; } .modal__body p { margin: 1em 0; } .modal__body p:first-child { margin-top: 0; } .modal__body p:last-child { margin-bottom: 0; } .modal__header { display: flex; padding: 24px; } .modal__header .typography__headline1 { min-height: 32px; margin-bottom: 0; padding-right: 48px; } .modal__header .typography__headline1:nth-child(n + 2) { margin-top: 0; } .modal__titleWrapper { display: flex; flex-direction: column; } .modal__subheader { margin-top: 4px; font-size: 12px; line-height: 18px; } .modal__icon { width: 40px; height: 40px; margin-right: 24px; padding: 8px; color: oklch(1 0 none); background-color: oklch(0.6764 0 none); border-radius: 50%; } .modal__icon--level-notice { background-color: oklch(0.7248 0.1476 233.1072); } .modal__icon--level-alert { background-color: oklch(0.7251 0.1625 65.1153); } .modal__icon--level-error { background-color: oklch(0.6752 0.2126 24.8868); } .modal__icon--level-success { background-color: oklch(0.6748 0.179 135.9604); } .modal__close { cursor: pointer; position: absolute; z-index: 2; top: 34px; right: 34px; } .modal__close:empty { cursor: pointer; top: 30px; right: 30px; width: 30px; height: 30px; } .modal__close:empty.shp-cross::before { color: oklch(0.7252 0 none); } .modal__close:empty:hover.shp-cross::before { color: oklch(0.4239 0 none); } .modal__content { padding: 0 24px 24px; } .modal__footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; padding: 0 24px 24px; } .modal__iframeContainer { position: relative; overflow: auto; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } #h1-modal { margin-bottom: 8px; padding-right: 24px; } `); }); });