Phase 5a-1 and 5a-2. - roles.ts names 51 color roles. One derivation rule fills the roles that a theme does not give, for all themes. tokens.css keeps only the root defaults, without theme blocks. - Each built-in theme is one data file in src/lib/theme/themes/. No code outside the theme data names a theme ID. characterThemes.ts is gone. - New roles: link, focus, on-accent, highlight, scrim, the syntax roles, and 16 terminal (ANSI) roles. Stray colors in components use the roles. - contrast.ts checks each theme against the readability rules of docs/ui-color.md. The tests mark the known palette failures as todo, and a second test fails when a known failure starts to pass. - Theme files use schema 3 with a mode and an optional built-in base. A short file gets the missing colors and fonts from the base. Schema 1 and 2 files still import. Old syntax names convert on import. - Docs: ui-color.md, plugin-development.md (theme tokens), ui-design.md, guides/themes.md, and UI-041 and UI-042 in design-decisions.md. The applied colors stay the same for every built-in theme, except three small changes: the conflict line uses the warn color, the Write highlight uses the highlight role, and two dialog backdrops use the scrim role. pnpm check passes. pnpm test: 447 pass, 31 todo, 0 fail. Full smoke suite: 93 passed, 2 known. appearance/palettes read the old syntax names and passed 3 of 3 times after the fix. workspace/manageTemplates failed one time and passed on retry.
26 lines
2.7 KiB
CSS
26 lines
2.7 KiB
CSS
/* Image frames, image actions, and the image viewer, from imageControls.ts. */
|
|
.md-image-frame { display: block; position: relative; width: fit-content; max-width: 100%; margin: 1.4em 0; }
|
|
.md-image-frame.is-selected, .md-image-frame:focus-visible { outline: 2px solid var(--rs-accent); outline-offset: 3px; border-radius: 6px; }
|
|
.md-image-frame.is-selected .md-image-actions { opacity: 1; }
|
|
.md-image-frame[data-error]::after { content: attr(data-error); display: block; padding: 8px; color: var(--rs-text); background: var(--rs-bg-elevated); font: 12px/1.5 var(--rs-font-ui); }
|
|
.writer-image-inline { display: inline-block; vertical-align: middle; max-width: 100%; }
|
|
.writer-image-inline .md-image-frame { margin: .5em 0; }
|
|
.image-drop-target { outline: 2px solid var(--rs-accent); outline-offset: -3px; }
|
|
.reading .md-image-frame img { margin: 0; }
|
|
.md-image-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 3px; border-radius: 6px; background: var(--rs-bg-elevated); box-shadow: 0 2px 8px #0005; opacity: 0; transition: opacity 100ms; }
|
|
.md-image-frame:hover .md-image-actions, .md-image-frame:focus-within .md-image-actions { opacity: 1; }
|
|
.image-action { position: relative; display: inline-grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 6px; color: var(--rs-text); border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
|
|
.image-action:hover, .image-action:focus-visible { background: var(--rs-bg-active); color: var(--rs-text-strong); }
|
|
.image-action:focus-visible { outline: 2px solid var(--rs-focus); outline-offset: 1px; }
|
|
.image-action:disabled { opacity: .4; cursor: default; }
|
|
.image-lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--rs-image-viewer-bg); color: var(--rs-text); }
|
|
.image-lightbox[open] { display: flex; flex-direction: column; }
|
|
.image-lightbox::backdrop { background: var(--rs-scrim); }
|
|
.image-lightbox-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--rs-bg-elevated); z-index: 1; }
|
|
.image-lightbox-name { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
.image-lightbox-scale { min-width: 44px; text-align: center; font-size: 12px; }
|
|
.image-lightbox-viewport { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; }
|
|
.image-lightbox-viewport img { display: block; flex-shrink: 0; max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }
|
|
.image-lightbox-viewport.is-zoomed { display: block; }
|
|
.image-lightbox-viewport.is-zoomed img { max-width: none; max-height: none; height: auto; }
|