/
githubmirror
/
tldraw
Обзор
Документация
Войти
/
githubmirror
/
tldraw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/dotcom/client/src/tla/components/dialogs/auth.module.css
342 строки
6 KB
Mime Čuvalo
fix(dotcom): stop sign-in dialog jumping for Clerk's invisible CAPTCHA (#9542)
10 июл 2026, 13:40
Не верифицирован
10 июл 2026, 13:40
df726fd
Код
Авторство
О чём код?
/* Auth Dialog Container */ .authContainer { width: 360px; max-width: 95vw; overflow-y: auto; } .authDialogBody { padding: 0; } .legalContainer { width: 360px; max-width: calc(100vw - 32px); } .legalDialogHeader { height: 0; padding: 0; overflow: hidden; } .authBody { display: flex; flex-direction: column; padding: 8px 20px 24px 20px; gap: 24px; } .legalBody { display: flex; flex-direction: column; align-items: stretch; gap: 24px; padding: 32px 28px 28px 28px; } /* Logo */ .authLogoWrapper { display: flex; justify-content: center; } .authLogo { width: 108px; height: 36px; display: flex; align-items: center; justify-content: center; } .authLogo span { width: 100%; height: 100%; } /* Description Text */ .authDescription { text-align: center; color: var(--tl-color-text-2); font-size: 12px; margin: 0; line-height: 1.5; text-wrap: balance; margin-bottom: 12px; } .legalDescription { max-width: 260px; margin: 0 auto; color: var(--tl-color-text-0); font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; text-wrap: balance; } .legalDescription a { color: var(--tl-color-selected); } /* Cta button */ .authCtaButton { height: 36px; width: 100%; font-size: 12px; font-weight: 500; } .legalCtaButton { margin-left: 0; } /* The google logo in the cta button on the sign in dialog */ .authCtaButton img { width: 22px; height: 22px; padding: var(--tl-space-2); z-index: 2; background-color: var(--tl-color-selected-contrast); border-radius: 100%; } /* Divider */ .authDivider { display: flex; align-items: center; text-align: center; color: var(--tl-color-text-3); font-size: 12px; margin: var(--tl-space-2) 0; font-style: italic; } .authDivider::before, .authDivider::after { content: ''; flex: 1; border-bottom: 1px solid var(--tl-color-muted-1); } .authDivider span { padding: 0 var(--tl-space-4); } /* Form Field */ .authField { display: flex; flex-direction: column; gap: var(--tl-space-3); } .authLabel { font-size: 12px; font-weight: 500; color: var(--tl-color-text-0); } .authInput { width: 100%; padding: var(--tl-space-2) var(--tl-space-4); background-color: var(--tl-color-muted-0); border: 1px solid var(--tl-color-muted-2); border-radius: var(--tl-radius-2); font-size: 12px; height: 36px; color: var(--tl-color-text-0); } .authInput:focus { outline: none; border-color: var(--tl-color-focus); background-color: var(--tl-color-background); } .authInput::placeholder { color: var(--tl-color-text-3); } /* Error Message */ .authError { font-size: 12px; color: var(--tl-color-danger); margin-top: var(--tl-space-1); text-align: center; text-wrap: balance; font-weight: 500; } /* * Pad the CAPTCHA only when there's a visible, interactive challenge. By * default Clerk runs an invisible ("smart") Turnstile challenge that mounts an * off-screen iframe and sets `max-height: 0` inline on the mount point; the * `:not([style*='max-height: 0'])` guard skips padding for that case, which * would otherwise briefly reserve 32px and make the dialog grow then shrink as * the challenge resolves. */ .clerkCaptcha:not(:empty):not([style*='max-height: 0']) { padding: var(--tl-space-8); margin-top: calc(-1 * var(--tl-space-8)); } .authTermsOfUse { margin-top: var(--tl-space-8); text-align: center; } .authTermsOfUse a { font-size: 12px; color: var(--tl-color-text-3); text-wrap: balance; font-weight: 500; } .authContinueWithEmailButton { margin-top: var(--tl-space-4); } /* Checkbox */ .authCheckboxLabel { display: flex; align-items: flex-start; justify-content: center; gap: var(--tl-space-4); cursor: pointer; font-size: 12px; color: var(--tl-color-text-0); line-height: 1.5; } .authCheckboxLabel a { color: var(--tl-color-selected); } .authCheckbox { width: 18px; height: 18px; min-width: 18px; margin-top: 2px; cursor: pointer; accent-color: var(--tl-color-selected); } /* Verification Code */ .authVerificationWrapper { display: flex; justify-content: center; margin: var(--tl-space-4) 0; position: relative; } /* OTP boxes */ .authOtpBoxes { display: grid; grid-template-columns: repeat(6, 40px); gap: var(--tl-space-3); } .authOtpBox { height: 48px; width: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--tl-color-muted-2); border-radius: var(--tl-radius-2); font-size: 20px; background: var(--tl-color-muted-0); } .authOtpBoxFocused { border: 1px solid var(--tl-color-selected); } .authOtpBoxFilled { background: var(--tl-color-background); } .authOtpCaret { width: 1px; height: 22px; background: var(--tl-color-text-0); display: inline-block; animation: otpCaretBlink 1s step-start infinite; } @keyframes otpCaretBlink { 50% { opacity: 0; } } .authOtpHiddenInput { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; pointer-events: auto; } /* Resend Code */ .authResendWrapper { display: flex; justify-content: center; align-items: center; font-size: 12px; margin-top: var(--tl-space-3); } .authResendText { color: var(--tl-color-text-2); } .authResendButton { background: none; border: none; color: var(--tl-color-selected); cursor: pointer; padding: 0; font-size: 12px; font-weight: 500; } .authResendButton:disabled { color: var(--tl-color-text-3); cursor: not-allowed; } .authTermsAcceptAndContinueButton { margin-top: var(--tl-space-4); } @media (max-width: 450px) { .authLogo { width: 108px; margin-bottom: 0; } .authContainer { max-width: 90vw; } .authCtaButton { height: 36px; } .authCtaButton img { height: 18px; width: 18px; } /* Inputs have 16px fontsize */ .authInput { font-size: 16px; } .authInput::placeholder { font-size: 12px; } }