openvibers/openvibe.shared ov-forms.css
ov-forms.css
| 1 | /* openvibe-shared/ov-forms.css — OpenVibe's own form controls, on every site (docs/forms.md). ov-forms.js draws the |
| 2 | * select (a button, its menu on a computer, its sheet on a phone); the rest is this file alone: |
| 3 | * |
| 4 | * every page checkboxes and radios are drawn (4.230.0: a box with a check that pops in, a ring with a dot; hover, a |
| 5 | * press, a focus glow), sliders and progress take the site's accent; a checkbox with role="switch" is |
| 6 | * a switch that glows when on and squeezes when pressed; buttons answer a press, text fields glow |
| 7 | * with focus; a file input's button is a button. All of it is :where(), so a site's own rule always |
| 8 | * wins; motion follows the person's setting (Calm slower, Off none) |
| 9 | * opted in .ov-field (a label, a control, a hint, an error) and .ov-input: the full field look; |
| 10 | * .ov-choices / .ov-choice: a choice drawn as a card (radio or checkbox inside) |
| 11 | * opted out data-ov-native on a control or any ancestor, or <html data-ov-forms="off"> |
| 12 | * |
| 13 | * Colours come from the site's theme (--accent, --bg-card, --border, --text-primary …), with system colours when a site |
| 14 | * has none, so light and dark both follow the site. */ |
| 15 | |
| 16 | /* ── The select's button ─────────────────────────────────────────────────────────────────────────────────────── */ |
| 17 | .ov-sel { |
| 18 | --ovf-accent: var(--accent, #3b82f6); |
| 19 | -webkit-appearance: none; appearance: none; box-sizing: border-box; |
| 20 | display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; min-height: 2.6em; |
| 21 | margin: 0; padding: .45em .65em .45em .8em; |
| 22 | font: inherit; line-height: 1.3; text-align: start; letter-spacing: inherit; |
| 23 | color: var(--text-primary, CanvasText); |
| 24 | background: var(--bg-input, var(--bg-tertiary, Field)); |
| 25 | border: 1px solid var(--border, color-mix(in srgb, CanvasText 20%, transparent)); |
| 26 | border-radius: var(--ov-radius-1, 10px); |
| 27 | cursor: pointer; -webkit-tap-highlight-color: transparent; |
| 28 | transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; |
| 29 | } |
| 30 | .ov-sel.is-block { display: flex; } |
| 31 | .ov-sel.is-full { width: 100%; } |
| 32 | .ov-sel[hidden] { display: none; } |
| 33 | .ov-sel:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ovf-accent) 50%, var(--border, color-mix(in srgb, CanvasText 20%, transparent))); } |
| 34 | .ov-sel:focus-visible { outline: none; border-color: var(--ovf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ovf-accent) 32%, transparent); } |
| 35 | .ov-sel[aria-expanded="true"] { border-color: var(--ovf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ovf-accent) 18%, transparent); } |
| 36 | .ov-sel:disabled { opacity: .55; cursor: not-allowed; } |
| 37 | .ov-sel.is-invalid { border-color: var(--danger, #ef4444); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #ef4444) 22%, transparent); } |
| 38 | .ov-sel-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; } |
| 39 | .ov-sel-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| 40 | .ov-sel.is-empty .ov-sel-text { color: var(--text-muted, color-mix(in srgb, CanvasText 55%, Canvas)); } |
| 41 | .ov-sel-chev { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--text-muted, color-mix(in srgb, CanvasText 55%, Canvas)); } |
| 42 | .ov-sel-chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; } |
| 43 | .ov-sel[aria-expanded="true"] .ov-sel-chev svg { transform: rotate(180deg); } |
| 44 | .ov-sel .ov-sel-badge { margin-inline-start: auto; } |
| 45 | /* data-ov-select="bare": the chip or toolbar around it is the box (4.109.1); the list is still OpenVibe's. */ |
| 46 | .ov-sel.is-bare { min-height: 0; padding: 0; gap: 6px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; box-shadow: none; } |
| 47 | .ov-sel.is-bare .ov-sel-chev, .ov-sel.is-bare .ov-sel-badge { display: none; } |
| 48 | .ov-sel.is-bare:hover:not(:disabled) { border-color: transparent; } |
| 49 | .ov-sel.is-bare:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ovf-accent) 45%, transparent); } |
| 50 | .ov-sel.is-bare[aria-expanded="true"] { box-shadow: none; } |
| 51 | .ov-sel-native { |
| 52 | position: absolute ; width: 1px ; height: 1px ; min-width: 0 ; min-height: 0 ; |
| 53 | margin: 0 ; padding: 0 ; border: 0 ; opacity: 0 ; pointer-events: none ; |
| 54 | clip-path: inset(50%) ; overflow: hidden ; |
| 55 | } |
| 56 | |
| 57 | /* ── The list: the menu, the sheet, and their rows ───────────────────────────────────────────────────────────── */ |
| 58 | .ov-sel-pop, .ov-sel-sheet { |
| 59 | --ovf-accent: var(--accent, #3b82f6); |
| 60 | --ovf-surface: var(--bg-card, var(--bg-secondary, Canvas)); |
| 61 | --ovf-text: var(--text-primary, CanvasText); |
| 62 | --ovf-muted: var(--text-muted, var(--text-secondary, color-mix(in srgb, CanvasText 58%, Canvas))); |
| 63 | --ovf-line: var(--border, color-mix(in srgb, CanvasText 14%, transparent)); |
| 64 | --ovf-hover: var(--bg-hover, color-mix(in srgb, CanvasText 7%, transparent)); |
| 65 | --ovf-ok: var(--success, #22c55e); --ovf-warn: var(--warning, #f59e0b); --ovf-bad: var(--danger, #ef4444); |
| 66 | box-sizing: border-box; z-index: 2147483000; display: flex; flex-direction: column; |
| 67 | color: var(--ovf-text); background: var(--ovf-surface); |
| 68 | font-family: inherit; font-size: 14px; line-height: 1.35; text-align: start; |
| 69 | } |
| 70 | /* In the top layer (4.109.2) the list is a popover: the browser's own popover box (centred, bordered, padded) is undone. */ |
| 71 | .ov-sel-pop[popover], .ov-sel-sheet[popover], .ov-sel-scrim[popover] { margin: 0; inset: auto; } |
| 72 | .ov-sel-pop[popover] { padding: 6px; border: 1px solid var(--ovf-line); overflow: hidden; } |
| 73 | .ov-sel-sheet[popover] { left: 0; right: 0; bottom: 0; width: auto; max-width: none; border: 0; } |
| 74 | .ov-sel-scrim[popover] { inset: 0; width: auto; height: auto; padding: 0; border: 0; } |
| 75 | .ov-sel-pop *, .ov-sel-sheet *, .ov-sel-pop *::before, .ov-sel-sheet *::after { box-sizing: border-box; } |
| 76 | .ov-sel-pop { |
| 77 | position: fixed; max-width: min(460px, calc(100vw - 16px)); padding: 6px; overflow: hidden; |
| 78 | border: 1px solid var(--ovf-line); border-radius: 12px; |
| 79 | box-shadow: 0 18px 48px -12px rgb(0 0 0 / .42), 0 3px 10px rgb(0 0 0 / .14); |
| 80 | opacity: 0; transform: translateY(-4px) scale(.985); transform-origin: top center; |
| 81 | transition: opacity .14s ease, transform .16s cubic-bezier(.2, .8, .2, 1); |
| 82 | } |
| 83 | .ov-sel-pop.is-up { transform: translateY(4px) scale(.985); transform-origin: bottom center; } |
| 84 | .ov-sel-pop.is-open { opacity: 1; transform: none; } |
| 85 | .ov-sel-sheet { |
| 86 | position: fixed; left: 0; right: 0; bottom: 0; max-height: min(86dvh, 680px); max-height: min(86vh, 680px); |
| 87 | padding: 0 max(8px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); |
| 88 | border-radius: var(--ov-radius-3, 20px) var(--ov-radius-3, 20px) 0 0; |
| 89 | box-shadow: 0 -14px 44px rgb(0 0 0 / .38); |
| 90 | font-size: 16px; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .85, .25, 1); |
| 91 | } |
| 92 | .ov-sel-sheet.is-open { transform: none; } |
| 93 | .ov-sel-scrim { position: fixed; inset: 0; z-index: 2147482999; background: rgb(6 10 16 / .5); opacity: 0; transition: opacity .2s ease; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); } |
| 94 | .ov-sel-scrim.is-open { opacity: 1; } |
| 95 | html.ov-sel-locked, html.ov-sel-locked body { overflow: hidden; overscroll-behavior: none; } |
| 96 | .ov-sel-sheet-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 8px 8px 12px; touch-action: none; cursor: grab; } |
| 97 | .ov-sel-grip { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 99px; background: color-mix(in srgb, var(--ovf-text) 22%, transparent); } |
| 98 | .ov-sel-sheet-title { flex: 1; min-width: 0; font-weight: 650; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| 99 | .ov-sel-done { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ovf-accent); font: inherit; font-weight: 650; cursor: pointer; } |
| 100 | .ov-sel-done:focus-visible { outline: 2px solid var(--ovf-accent); outline-offset: 2px; } |
| 101 | |
| 102 | .ov-sel-search { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 10px; min-height: 40px; border-radius: 9px; background: var(--ovf-hover); color: var(--ovf-muted); cursor: text; } |
| 103 | .ov-sel-sheet .ov-sel-search { margin: 4px 4px 8px; min-height: 46px; border-radius: 12px; } |
| 104 | .ov-sel-search svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; } |
| 105 | .ov-sel-search input { flex: 1; min-width: 0; height: 100%; min-height: 36px; padding: 0; border: 0; outline: 0; background: none; color: var(--ovf-text); font: inherit; } |
| 106 | .ov-sel-sheet .ov-sel-search input { font-size: 16px; } /* a phone does not zoom into a 16 px field */ |
| 107 | .ov-sel-search input::-webkit-search-cancel-button { cursor: pointer; } |
| 108 | |
| 109 | .ov-sel-list { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; } |
| 110 | .ov-sel-opt { |
| 111 | display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; margin: 1px 0; |
| 112 | border-radius: 8px; cursor: pointer; scroll-margin: 6px; -webkit-tap-highlight-color: transparent; |
| 113 | } |
| 114 | .ov-sel-sheet .ov-sel-opt { min-height: 54px; padding: 10px 12px; border-radius: 12px; } |
| 115 | .ov-sel-opt:hover, .ov-sel-opt.is-active { background: var(--ovf-hover); } |
| 116 | .ov-sel-opt.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ovf-accent) 35%, transparent); } |
| 117 | @media (hover: none) { .ov-sel-opt.is-active:not(:focus-within) { box-shadow: none; } } |
| 118 | .ov-sel-opt[aria-selected="true"] { background: color-mix(in srgb, var(--ovf-accent) 11%, transparent); } |
| 119 | .ov-sel-opt[aria-selected="true"] .ov-sel-label { font-weight: 650; } |
| 120 | .ov-sel-opt.is-disabled { cursor: default; } |
| 121 | .ov-sel-opt.is-disabled .ov-sel-words { opacity: .55; } |
| 122 | .ov-sel-words { flex: 1; min-width: 0; display: grid; gap: 2px; } |
| 123 | .ov-sel-label { overflow-wrap: anywhere; } |
| 124 | .ov-sel-desc { color: var(--ovf-muted); font-size: .86em; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } |
| 125 | .ov-sel-mark { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--ovf-accent); } |
| 126 | .ov-sel-mark svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .14s ease; } |
| 127 | .ov-sel-opt[aria-selected="true"] .ov-sel-mark svg { opacity: 1; transform: none; } |
| 128 | .ov-sel-mark.is-box { border: 1.5px solid color-mix(in srgb, var(--ovf-text) 35%, transparent); border-radius: 5px; color: #fff; } |
| 129 | .ov-sel-mark.is-box svg { width: 13px; height: 13px; stroke-width: 3; } |
| 130 | .ov-sel-opt[aria-selected="true"] .ov-sel-mark.is-box { background: var(--ovf-accent); border-color: var(--ovf-accent); color: var(--on-accent, #fff); } |
| 131 | .ov-sel-icon { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-size: 15px; line-height: 1; } |
| 132 | .ov-sel-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, CanvasText 30%, transparent); } |
| 133 | .ov-sel-dot.is-ok { background: var(--ovf-ok, var(--success, #22c55e)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success, #22c55e) 20%, transparent); } |
| 134 | .ov-sel-dot.is-warn { background: var(--ovf-warn, var(--warning, #f59e0b)); } |
| 135 | .ov-sel-dot.is-bad { background: var(--ovf-bad, var(--danger, #ef4444)); } |
| 136 | .ov-sel-dot.is-new { background: var(--accent, #3b82f6); } |
| 137 | .ov-sel-badge { |
| 138 | flex: none; display: inline-flex; align-items: center; min-height: 20px; padding: 1px 8px; border-radius: 999px; |
| 139 | font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; |
| 140 | color: var(--text-secondary, color-mix(in srgb, CanvasText 70%, Canvas)); background: color-mix(in srgb, CanvasText 8%, transparent); |
| 141 | } |
| 142 | .ov-sel-badge.is-ok { color: var(--success-text, var(--success, #15803d)); background: color-mix(in srgb, var(--success, #22c55e) 15%, transparent); } |
| 143 | .ov-sel-badge.is-warn { color: var(--warning-text, var(--warning, #b45309)); background: color-mix(in srgb, var(--warning, #f59e0b) 17%, transparent); } |
| 144 | .ov-sel-badge.is-bad { color: var(--danger-text, var(--danger, #b91c1c)); background: color-mix(in srgb, var(--danger, #ef4444) 15%, transparent); } |
| 145 | .ov-sel-badge.is-new { color: var(--accent, #3b82f6); background: color-mix(in srgb, var(--accent, #3b82f6) 15%, transparent); } |
| 146 | .ov-sel-link { flex: none; display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; color: var(--ovf-accent); background: color-mix(in srgb, var(--ovf-accent) 12%, transparent); font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap; } |
| 147 | .ov-sel-sheet .ov-sel-link { min-height: 38px; padding: 0 14px; font-size: 14px; } |
| 148 | .ov-sel-link:hover { background: color-mix(in srgb, var(--ovf-accent) 20%, transparent); } |
| 149 | .ov-sel-link:focus-visible { outline: 2px solid var(--ovf-accent); outline-offset: 2px; } |
| 150 | .ov-sel-group { padding: 10px 10px 4px; color: var(--ovf-muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; } |
| 151 | .ov-sel-group:first-child { padding-top: 4px; } |
| 152 | .ov-sel-none { padding: 18px 12px; color: var(--ovf-muted); text-align: center; } |
| 153 | |
| 154 | /* ── Every page: OpenVibe's own controls, in the site's colours ──────────────────────────────────────────────── */ |
| 155 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"], input[type="radio"], input[type="range"], progress, meter):where(:not([data-ov-native], [data-ov-native] *)) { |
| 156 | accent-color: var(--accent, #3b82f6); |
| 157 | } |
| 158 | /* 4.230.0 (the owner, 11-12: "improve the selection boxes … a more customized look … themed better with animations and |
| 159 | effects for all inputs and buttons"): a checkbox is a rounded box whose check pops in, a radio a ring whose dot |
| 160 | grows; both lift their border on hover, squeeze on a press and glow with focus. The mark is the box's own ::before |
| 161 | (clip-path check, scaled), so no picture is fetched and no page's image policy is involved. */ |
| 162 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *)) { |
| 163 | -webkit-appearance: none; appearance: none; box-sizing: border-box; flex: none; vertical-align: middle; |
| 164 | display: inline-grid; place-content: center; width: 18px; height: 18px; cursor: pointer; |
| 165 | border: 1.5px solid color-mix(in srgb, var(--text-primary, CanvasText) 38%, transparent); border-radius: 6px; |
| 166 | background: var(--bg-input, color-mix(in srgb, var(--text-primary, CanvasText) 5%, transparent)); color: var(--accent, #3b82f6); |
| 167 | transition: background-color .16s ease, border-color .16s ease, box-shadow .2s ease, transform .12s ease; |
| 168 | } |
| 169 | :where(html:not([data-ov-forms="off"])) :where(input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *)) { border-radius: 50%; } |
| 170 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *))::before { |
| 171 | content: ""; width: 10px; height: 10px; transform: scale(0); transform-origin: 50% 60%; |
| 172 | box-shadow: inset 1em 1em var(--on-accent, #fff); |
| 173 | clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); |
| 174 | transition: transform .18s cubic-bezier(.2, 1.5, .4, 1); |
| 175 | } |
| 176 | :where(html:not([data-ov-forms="off"])) :where(input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *))::before { |
| 177 | width: 8px; height: 8px; border-radius: 50%; clip-path: none; box-shadow: inset 1em 1em var(--accent, #3b82f6); transform-origin: 50% 50%; |
| 178 | } |
| 179 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]):checked, input[type="checkbox"]:not([role="switch"]):indeterminate):where(:not([data-ov-native], [data-ov-native] *)) { |
| 180 | background: var(--accent, #3b82f6); border-color: var(--accent, #3b82f6); |
| 181 | } |
| 182 | :where(html:not([data-ov-forms="off"])) :where(input[type="radio"]:checked):where(:not([data-ov-native], [data-ov-native] *)) { |
| 183 | border-color: var(--accent, #3b82f6); border-width: 2px; |
| 184 | } |
| 185 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]):checked, input[type="radio"]:checked):where(:not([data-ov-native], [data-ov-native] *))::before { transform: scale(1); } |
| 186 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]):indeterminate):where(:not([data-ov-native], [data-ov-native] *))::before { |
| 187 | transform: scale(1); height: 2.5px; border-radius: 2px; clip-path: none; |
| 188 | } |
| 189 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)):hover { |
| 190 | border-color: color-mix(in srgb, var(--accent, #3b82f6) 70%, transparent); |
| 191 | box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #3b82f6) 12%, transparent); |
| 192 | } |
| 193 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"], input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)):active { transform: scale(.88); } |
| 194 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *)):focus-visible { |
| 195 | box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #3b82f6) 28%, transparent); |
| 196 | } |
| 197 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"]:not([role="switch"]), input[type="radio"]):where(:not([data-ov-native], [data-ov-native] *)):disabled { opacity: .5; cursor: not-allowed; } |
| 198 | /* Buttons answer a press; text fields glow with focus (a site's own button or field rule wins over these). */ |
| 199 | :where(html:not([data-ov-forms="off"])) :where(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, .btn, [role="button"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)) { |
| 200 | transition: transform .12s ease, box-shadow .18s ease, background-color .16s ease, border-color .16s ease, color .16s ease; |
| 201 | } |
| 202 | :where(html:not([data-ov-forms="off"])) :where(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, .btn, [role="button"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)):active { transform: scale(.97); } |
| 203 | :where(html:not([data-ov-forms="off"])) :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="button"], [type="submit"], [type="reset"]), textarea, select):where(:not([data-ov-native], [data-ov-native] *)) { |
| 204 | transition: border-color .15s ease, box-shadow .2s ease, background-color .15s ease; |
| 205 | } |
| 206 | :where(html:not([data-ov-forms="off"])) :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="button"], [type="submit"], [type="reset"]), textarea, select):where(:not([data-ov-native], [data-ov-native] *)):focus-visible { |
| 207 | outline: 2px solid var(--accent, #3b82f6); outline-offset: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #3b82f6) 22%, transparent); |
| 208 | } |
| 209 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"], input[type="radio"], input[type="range"]):where(:not([data-ov-native], [data-ov-native] *)):focus-visible { |
| 210 | outline: 2px solid var(--accent, #3b82f6); outline-offset: 2px; |
| 211 | } |
| 212 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]):where(:not([data-ov-native], [data-ov-native] *)) { |
| 213 | -webkit-appearance: none; appearance: none; box-sizing: border-box; flex: none; vertical-align: middle; |
| 214 | width: 42px; height: 24px; margin: 0; border: 0; border-radius: 999px; cursor: pointer; |
| 215 | background-color: color-mix(in srgb, CanvasText 26%, transparent); |
| 216 | background-image: radial-gradient(circle, #fff 0 8.5px, transparent 9px); |
| 217 | background-repeat: no-repeat; background-size: 20px 20px; background-position: 2px 50%; |
| 218 | box-shadow: inset 0 0 0 1px color-mix(in srgb, CanvasText 10%, transparent); |
| 219 | transition: background-color .18s ease, background-position .2s cubic-bezier(.3, .8, .3, 1); |
| 220 | } |
| 221 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]:checked):where(:not([data-ov-native], [data-ov-native] *)) { |
| 222 | background-color: var(--accent, #3b82f6); background-position: calc(100% - 2px) 50%; |
| 223 | box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 12%, transparent), 0 0 14px color-mix(in srgb, var(--accent, #3b82f6) 38%, transparent); |
| 224 | } |
| 225 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)):hover { |
| 226 | background-color: color-mix(in srgb, CanvasText 34%, transparent); |
| 227 | } |
| 228 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]:checked):where(:not([data-ov-native], [data-ov-native] *, :disabled)):hover { |
| 229 | background-color: color-mix(in srgb, var(--accent, #3b82f6) 88%, #fff); |
| 230 | } |
| 231 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]):where(:not([data-ov-native], [data-ov-native] *, :disabled)):active { |
| 232 | transform: none; background-image: radial-gradient(ellipse 13px 8.5px, #fff 0 92%, transparent 100%); background-size: 26px 20px; |
| 233 | } |
| 234 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]:checked):where(:not([data-ov-native], [data-ov-native] *, :disabled)):active { background-position: calc(100% - 2px) 50%; } |
| 235 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]):where(:not([data-ov-native], [data-ov-native] *)):focus-visible { |
| 236 | outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #3b82f6) 30%, transparent); |
| 237 | } |
| 238 | /* Motion follows the person: Calm takes its time, Off moves nothing (the state still changes). */ |
| 239 | html[data-ov-motion="calm"] :where(input[type="checkbox"], input[type="radio"], button, .btn)::before { transition-duration: .32s; } |
| 240 | html[data-ov-motion="off"] :where(input[type="checkbox"], input[type="radio"], button, input[type="button"], input[type="submit"], .btn, [role="button"], input, textarea, select), |
| 241 | html[data-ov-motion="off"] :where(input[type="checkbox"], input[type="radio"])::before { transition: none ; animation: none ; } |
| 242 | html[data-ov-motion="off"] :where(input[type="checkbox"], input[type="radio"], button, .btn, [role="button"]):active { transform: none ; } |
| 243 | :where(html:not([data-ov-forms="off"])) :where(input[type="checkbox"][role="switch"]:disabled) { opacity: .5; cursor: not-allowed; } |
| 244 | :where(html:not([data-ov-forms="off"])) :where(input[type="file"]:not([data-ov-native]))::file-selector-button { |
| 245 | font: inherit; font-weight: 600; margin-inline-end: .75em; padding: .38em .85em; cursor: pointer; |
| 246 | color: var(--text-primary, CanvasText); background: var(--bg-hover, color-mix(in srgb, CanvasText 8%, transparent)); |
| 247 | border: 1px solid var(--border, color-mix(in srgb, CanvasText 18%, transparent)); border-radius: 8px; |
| 248 | } |
| 249 | |
| 250 | /* ── Opted in: a field, an input, choices as cards ──────────────────────────────────────────────────────────── */ |
| 251 | .ov-field { --ovf-accent: var(--accent, #3b82f6); display: grid; gap: 6px; min-width: 0; } |
| 252 | .ov-field > label, .ov-field-label { font-size: 13px; font-weight: 650; color: var(--text-primary, CanvasText); } |
| 253 | .ov-field-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-muted, color-mix(in srgb, CanvasText 58%, Canvas)); } |
| 254 | .ov-field-error { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--danger-text, var(--danger, #dc2626)); } |
| 255 | .ov-input, |
| 256 | .ov-field :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"]), textarea) { |
| 257 | -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; margin: 0; |
| 258 | padding: 10px 12px; font: inherit; line-height: 1.4; color: var(--text-primary, CanvasText); |
| 259 | background: var(--bg-input, var(--bg-tertiary, Field)); |
| 260 | border: 1px solid var(--border, color-mix(in srgb, CanvasText 20%, transparent)); border-radius: var(--ov-radius-1, 10px); |
| 261 | transition: border-color .15s ease, box-shadow .15s ease; |
| 262 | } |
| 263 | .ov-field textarea, textarea.ov-input { min-height: 96px; resize: vertical; } |
| 264 | .ov-field .ov-sel { min-height: 44px; padding-inline-start: 12px; } |
| 265 | .ov-input::placeholder, .ov-field :is(input, textarea)::placeholder { color: var(--text-muted, color-mix(in srgb, CanvasText 45%, Canvas)); opacity: 1; } |
| 266 | .ov-input:hover, .ov-field :is(input, textarea):hover { border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--border, color-mix(in srgb, CanvasText 20%, transparent))); } |
| 267 | .ov-input:focus-visible, .ov-field :is(input, textarea):focus-visible, .ov-input:focus, .ov-field :is(input, textarea):focus { |
| 268 | outline: none; border-color: var(--accent, #3b82f6); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 30%, transparent); |
| 269 | } |
| 270 | .ov-input[aria-invalid="true"], .ov-field :is(input, textarea)[aria-invalid="true"], .ov-input:user-invalid, .ov-field :is(input, textarea):user-invalid { |
| 271 | border-color: var(--danger, #ef4444); |
| 272 | } |
| 273 | @media (pointer: coarse) { .ov-input, .ov-field :is(input, textarea), .ov-sel { font-size: max(16px, 1em); } } |
| 274 | |
| 275 | .ov-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; } |
| 276 | .ov-choice { |
| 277 | position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding: 14px; box-sizing: border-box; |
| 278 | border: 1px solid var(--border, color-mix(in srgb, CanvasText 18%, transparent)); border-radius: var(--ov-radius-2, 14px); |
| 279 | background: var(--bg-card, transparent); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; |
| 280 | } |
| 281 | .ov-choice:hover { border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--border, transparent)); } |
| 282 | .ov-choice:has(input:checked) { border-color: var(--accent, #3b82f6); box-shadow: 0 0 0 1px var(--accent, #3b82f6); background: color-mix(in srgb, var(--accent, #3b82f6) 7%, var(--bg-card, transparent)); } |
| 283 | .ov-choice:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3b82f6) 35%, transparent); } |
| 284 | .ov-choice:has(input:disabled) { opacity: .6; cursor: not-allowed; } |
| 285 | .ov-choice > input { flex: none; margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent, #3b82f6); } |
| 286 | .ov-choice-body { display: grid; gap: 3px; min-width: 0; } |
| 287 | .ov-choice-title { font-weight: 650; } |
| 288 | .ov-choice-desc { font-size: 12.5px; line-height: 1.45; color: var(--text-muted, color-mix(in srgb, CanvasText 58%, Canvas)); } |
| 289 | .ov-choice .ov-sel-badge { position: absolute; top: 12px; right: 12px; } |
| 290 | |
| 291 | @media (forced-colors: active) { |
| 292 | .ov-sel, .ov-sel-pop, .ov-sel-sheet { border: 1px solid CanvasText; } |
| 293 | .ov-sel-opt.is-active, .ov-sel-opt[aria-selected="true"] { outline: 2px solid Highlight; } |
| 294 | } |
| 295 |