-
Notifications
You must be signed in to change notification settings - Fork 5
Migrate Form components using Formisch and Valibot
#65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
515cc62
efd7ac3
ff55cc6
209ca7e
48ff77a
a80d6c4
7d64794
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,378 @@ | ||
| /* | ||
| DrFed: A web-based platform for developing and debugging ActivityPub apps | ||
| Copyright (C) 2026 DrFed team | ||
|
|
||
| This program is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU Affero General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU Affero General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU Affero General Public License | ||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| * { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| html { | ||
| background: var(--bg); | ||
| color: var(--ink); | ||
| font-family: var(--font-sans); | ||
| font-size: var(--text-body); | ||
| } | ||
|
|
||
| body { | ||
| margin: 0; | ||
| } | ||
|
|
||
| button, | ||
| input { | ||
| font: inherit; | ||
| } | ||
|
|
||
| .app-shell { | ||
| min-height: 100svh; | ||
| } | ||
|
|
||
| .app-header { | ||
| background: color-mix(in srgb, var(--bg) 92%, transparent); | ||
| border-bottom: 1px solid var(--line); | ||
| position: sticky; | ||
| top: 0; | ||
| z-index: 10; | ||
| } | ||
|
|
||
| .app-header-inner { | ||
| align-items: center; | ||
| display: flex; | ||
| height: var(--header-h); | ||
| margin: 0 auto; | ||
| max-width: var(--container); | ||
| padding: 0 var(--gutter); | ||
| } | ||
|
|
||
| .brand { | ||
| align-items: center; | ||
| color: var(--ink); | ||
| display: flex; | ||
| font-family: var(--font-serif); | ||
| font-size: 1.25rem; | ||
| font-weight: 700; | ||
| gap: 0.65rem; | ||
| letter-spacing: var(--tracking-heading); | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .brand img { | ||
| border-radius: 50%; | ||
| } | ||
|
|
||
| .app-nav { | ||
| align-self: stretch; | ||
| display: flex; | ||
| gap: 0.25rem; | ||
| margin-left: clamp(1.5rem, 5vw, 4rem); | ||
| } | ||
|
|
||
| .app-nav a, | ||
| .header-action { | ||
| align-items: center; | ||
| color: var(--ink-soft); | ||
| display: flex; | ||
| font-size: 0.9rem; | ||
| font-weight: 600; | ||
| padding: 0 0.85rem; | ||
| position: relative; | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .app-nav a:hover, | ||
| .header-action:hover, | ||
| .app-nav a.is-active, | ||
| .header-action.is-active { | ||
| color: var(--ink); | ||
| } | ||
|
|
||
| .app-nav a.is-active::after { | ||
| background: var(--accent); | ||
| bottom: -1px; | ||
| content: ""; | ||
| height: 3px; | ||
| left: 0.85rem; | ||
| position: absolute; | ||
| right: 0.85rem; | ||
| } | ||
|
|
||
| .header-action { | ||
| border: 1px solid var(--line-strong); | ||
| border-radius: var(--radius-pill); | ||
| margin-left: auto; | ||
| min-height: 2.4rem; | ||
| } | ||
|
|
||
| .header-action.is-active { | ||
| background: var(--accent-tint); | ||
| border-color: var(--accent-soft); | ||
| } | ||
|
|
||
| .app-header a:focus-visible { | ||
| outline: 3px solid var(--accent-soft); | ||
| outline-offset: 0.2rem; | ||
| } | ||
|
|
||
| .app-content { | ||
| margin: 0 auto; | ||
| max-width: var(--container); | ||
| min-height: calc(100svh - var(--header-h)); | ||
| padding: clamp(2rem, 5vw, 4rem) var(--gutter); | ||
| } | ||
|
|
||
| .app-content > main:not(.form-page) { | ||
| width: 100%; | ||
| } | ||
|
|
||
| .app-content > main:not(.form-page) :is(h1, h2, p) { | ||
| margin-top: 0; | ||
| } | ||
|
|
||
| .app-content h1, | ||
| .app-content h2 { | ||
| font-family: var(--font-serif); | ||
| letter-spacing: var(--tracking-heading); | ||
| } | ||
|
|
||
| .app-content h1 { | ||
| font-size: var(--text-heading-2); | ||
| line-height: var(--leading-heading); | ||
| } | ||
|
|
||
| .app-content p { | ||
| color: var(--ink-soft); | ||
| line-height: var(--leading-body); | ||
| } | ||
|
|
||
| .form-page { | ||
| align-items: center; | ||
| display: flex; | ||
| justify-content: center; | ||
| min-height: calc(100svh - var(--header-h) - clamp(4rem, 10vw, 8rem)); | ||
| } | ||
|
|
||
| .panel { | ||
| background: var(--card); | ||
| border: 1px solid var(--line); | ||
| border-radius: var(--radius); | ||
| box-shadow: var(--shadow-sm); | ||
| } | ||
|
|
||
| .form-panel { | ||
| max-width: 28rem; | ||
| padding: clamp(1.5rem, 4vw, 2rem); | ||
| width: 100%; | ||
| } | ||
|
|
||
| .panel-header { | ||
| border-bottom: 1px solid var(--line); | ||
| margin: 0 calc(clamp(1.5rem, 4vw, 2rem) * -1) 1.5rem; | ||
| padding: 0 clamp(1.5rem, 4vw, 2rem) 1.5rem; | ||
| } | ||
|
|
||
| .panel-header h1 { | ||
| font-size: 1.65rem; | ||
| margin: 0 0 0.5rem; | ||
| } | ||
|
|
||
| .panel-header p { | ||
| font-size: 0.95rem; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .form-panel form { | ||
| display: grid; | ||
| gap: 1rem; | ||
| } | ||
|
|
||
| .field { | ||
| display: grid; | ||
| gap: 0.5rem; | ||
| } | ||
|
|
||
| .field-heading { | ||
| align-items: baseline; | ||
| display: flex; | ||
| font-size: 0.9rem; | ||
| font-weight: 650; | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| .field-status { | ||
| color: var(--ink-faint); | ||
| font-family: var(--font-mono); | ||
| font-size: 0.68rem; | ||
| font-weight: 500; | ||
| letter-spacing: 0.04em; | ||
| text-transform: uppercase; | ||
| } | ||
|
|
||
| .field-status.required { | ||
| color: var(--accent-strong); | ||
| } | ||
|
|
||
| .field input { | ||
| background: var(--surface-2); | ||
| border: 1px solid var(--line-strong); | ||
| border-radius: var(--radius-sm); | ||
| color: var(--ink); | ||
| min-width: 0; | ||
| padding: 0.9rem 1rem; | ||
| transition: | ||
| border-color var(--duration-fast) var(--ease-standard), | ||
| box-shadow var(--duration-fast) var(--ease-standard); | ||
| } | ||
|
|
||
| .field input::placeholder { | ||
| color: var(--ink-faint); | ||
| } | ||
|
|
||
| .field input:focus { | ||
| border-color: var(--accent); | ||
| box-shadow: 0 0 0 3px var(--accent-tint); | ||
| outline: none; | ||
| } | ||
|
|
||
| .field input:read-only { | ||
| border-style: dashed; | ||
| color: var(--ink-soft); | ||
| cursor: default; | ||
| font-family: var(--font-mono); | ||
| } | ||
|
|
||
| .field-hint { | ||
| color: var(--ink-faint); | ||
| font-size: 0.78rem; | ||
| line-height: 1.45; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .field-error { | ||
| color: var(--danger); | ||
| font-size: 0.78rem; | ||
| line-height: 1.45; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .field input[aria-invalid="true"] { | ||
| border-color: var(--danger); | ||
| } | ||
|
|
||
| .field input[aria-invalid="true"]:focus { | ||
| border-color: var(--danger); | ||
| box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); | ||
| } | ||
|
|
||
| .button { | ||
| align-items: center; | ||
| border: 0; | ||
| border-radius: var(--radius-sm); | ||
| cursor: pointer; | ||
| display: inline-flex; | ||
| font-weight: 700; | ||
| justify-content: center; | ||
| min-height: 2.9rem; | ||
| padding: 0.75rem 1.1rem; | ||
| } | ||
|
|
||
| .button:focus-visible { | ||
| outline: 3px solid var(--accent-soft); | ||
| outline-offset: 0.2rem; | ||
| } | ||
|
|
||
| .button.primary { | ||
| background: var(--accent); | ||
| color: var(--on-accent); | ||
| transition: | ||
| background var(--duration-fast) var(--ease-standard), | ||
| transform var(--duration-fast) var(--ease-standard); | ||
| } | ||
|
|
||
| .button.primary:hover:not(:disabled) { | ||
| background: var(--accent-strong); | ||
| } | ||
|
|
||
| .button:disabled { | ||
| cursor: wait; | ||
| opacity: 0.65; | ||
| } | ||
|
|
||
| .notice { | ||
| background: var(--accent-tint); | ||
| border-radius: var(--radius-sm); | ||
| color: var(--ink); | ||
| line-height: 1.5; | ||
| margin: 1.25rem 0 0; | ||
| padding: 0.85rem 1rem; | ||
| } | ||
|
|
||
| .notice.error { | ||
| background: color-mix(in srgb, var(--danger) 12%, var(--surface)); | ||
| border-left: 3px solid var(--danger); | ||
| color: var(--danger); | ||
| } | ||
|
|
||
| .notice.success { | ||
| background: color-mix(in srgb, var(--success) 12%, var(--surface)); | ||
| border-left: 3px solid var(--success); | ||
| color: var(--success); | ||
| } | ||
|
Comment on lines
+328
to
+332
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When sign-in succeeds or either form renders an error, these semantic rules never run: Useful? React with 👍 / 👎. |
||
|
|
||
| .notice.warning { | ||
| background: color-mix(in srgb, var(--warning) 12%, var(--surface)); | ||
| border-left: 3px solid var(--warning); | ||
| color: var(--warning); | ||
| } | ||
|
|
||
| @media (max-width: 600px) { | ||
| .app-header-inner { | ||
| padding: 0 1rem; | ||
| } | ||
|
|
||
| .brand span { | ||
| display: none; | ||
| } | ||
|
|
||
| .app-nav { | ||
| margin-left: 0.75rem; | ||
| } | ||
|
|
||
| .app-nav a, | ||
| .header-action { | ||
| padding-inline: 0.65rem; | ||
| } | ||
|
|
||
| .app-nav a.is-active::after { | ||
| left: 0.65rem; | ||
| right: 0.65rem; | ||
| } | ||
|
|
||
| .app-content { | ||
| padding: 1.5rem 1rem 3rem; | ||
| } | ||
|
|
||
| .form-page { | ||
| align-items: flex-start; | ||
| min-height: auto; | ||
| } | ||
| } | ||
|
|
||
| @media (prefers-reduced-motion: reduce) { | ||
| .button.primary, | ||
| .field input { | ||
| transition: none; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.