Follow-up to #814 (081c67ac). The core request injection is unchanged.
- Page: static text goes back to English when magpie.theme.lang changes
from zh to en. Unsaved style picks survive a language change, and the
title follows the language. zh / zh-CN / zh-Hans use the Simplified
strings. zh-TW and other languages fall back to English on purpose,
with <html lang> kept as zh-TW. With no host theme, the page loads in
English without throwing.
- apply.js: an empty system message gets the style block with no
leading blank lines. The unused media detector and addedBytes are
removed.
- style.css: obsolete stats/lang/workspace rules are removed, and the
720px media block is closed again (52 { / 52 }).
- Tests: lowercase "delete" in the cross-turn cache case;
empty/null/object system; zh -> en restore; unsaved picks kept;
zh-TW; a missing theme; style.css brace balance and the version.
- PROVENANCE names ANTISLOP_BOUNDARIES (OmniRoute v3.8.52), checked
byte for byte against the tag. The page/stats.js ignore is gone.
- Version 0.2.1. dist had only 0.2.0, and npm has no version yet.
Run at 2f971ab9 (mote, Bun 1.4.2, fresh HOME):
- package bun test: 55 pass, 0 fail;
- repo bun test: 6561 pass, 20 skip, 0 fail;
- scripts/check.mjs output-strategy: ok;
- CI run 42320776930 at this head, attempt 1: test and on-npm green;
- page render, main vs head, in Chromium and WebKit at 400/700/1000px:
identical.
Broken by hand, each turning exactly one test red: the dropped }, the
version at 0.2.0, an unguarded theme.lang, the old conditional
applyTheme, a case-sensitive delete skip, the old appendInstruction,
one-way translate, unkept checkbox state, the old zh* normalize, and
addedBytes put back.
Not tried: a live theme switch in the real magpie window, and real
Claude Code/Codex sessions.
287 lines
5.2 KiB
CSS
287 lines
5.2 KiB
CSS
:root {
|
|
color-scheme: light dark;
|
|
--paper: var(--magpie-bg, #f3f5f4);
|
|
--surface: var(--magpie-card, #ffffff);
|
|
--ink: var(--magpie-fg, #1d2523);
|
|
--muted: var(--magpie-muted, #63706c);
|
|
--line: var(--magpie-line, #d5dcd8);
|
|
--accent: var(--magpie-accent, #315f72);
|
|
--accent-soft: var(--magpie-accent-soft, #e7eff2);
|
|
--danger: var(--magpie-red, #9b3535);
|
|
font-family: var(--magpie-font, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif);
|
|
font-synthesis: none;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
body {
|
|
margin: 0;
|
|
min-width: 0;
|
|
background: var(--paper);
|
|
color: var(--ink);
|
|
font-size: 14px;
|
|
line-height: 1.55;
|
|
}
|
|
|
|
button,
|
|
input { font: inherit; }
|
|
|
|
button,
|
|
label,
|
|
input { -webkit-tap-highlight-color: transparent; }
|
|
|
|
.shell {
|
|
width: min(100% - 48px, 780px);
|
|
margin: 0 auto;
|
|
padding: 42px 0 36px;
|
|
}
|
|
|
|
.intro {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: flex-end;
|
|
justify-content: space-between;
|
|
gap: 16px 24px;
|
|
padding-bottom: 25px;
|
|
border-bottom: 2px solid var(--ink);
|
|
}
|
|
|
|
h1,
|
|
h2,
|
|
h3,
|
|
p { margin-top: 0; }
|
|
|
|
h1 {
|
|
margin-bottom: 7px;
|
|
font-size: clamp(28px, 4vw, 40px);
|
|
font-weight: 680;
|
|
line-height: 1.15;
|
|
letter-spacing: -0.035em;
|
|
}
|
|
|
|
.lede {
|
|
max-width: 580px;
|
|
margin-bottom: 0;
|
|
color: var(--muted);
|
|
font-size: 15px;
|
|
}
|
|
|
|
.selection-count {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
flex: none;
|
|
margin-bottom: 1px;
|
|
color: var(--muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.selection-count strong {
|
|
color: var(--accent);
|
|
font-size: 23px;
|
|
font-variant-numeric: tabular-nums;
|
|
font-weight: 650;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.styles-section { padding-top: 28px; }
|
|
|
|
.section-heading {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
gap: 16px;
|
|
margin-bottom: 11px;
|
|
}
|
|
|
|
.section-heading h2 {
|
|
flex: none;
|
|
margin-bottom: 0;
|
|
font-size: 16px;
|
|
font-weight: 650;
|
|
}
|
|
|
|
.section-heading p {
|
|
margin-bottom: 0;
|
|
color: var(--muted);
|
|
font-size: 12px;
|
|
text-align: right;
|
|
}
|
|
|
|
fieldset {
|
|
min-width: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
}
|
|
|
|
.styles-list {
|
|
border-top: 1px solid var(--line);
|
|
}
|
|
|
|
.style-row {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 20px;
|
|
min-height: 76px;
|
|
padding: 14px 12px 14px 16px;
|
|
border-bottom: 1px solid var(--line);
|
|
cursor: pointer;
|
|
transition: background-color 120ms ease;
|
|
}
|
|
|
|
.style-row::before {
|
|
position: absolute;
|
|
inset: 14px auto 14px 0;
|
|
width: 3px;
|
|
background: transparent;
|
|
content: "";
|
|
}
|
|
|
|
.style-row:hover { background: rgb(255 255 255 / 55%); }
|
|
.style-row:has(input:checked) { background: var(--accent-soft); }
|
|
.style-row:has(input:checked)::before { background: var(--accent); }
|
|
.style-row:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
|
|
.style-row:has(input:disabled) { cursor: default; opacity: 0.65; }
|
|
|
|
.style-copy {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 3px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.style-name {
|
|
font-size: 15px;
|
|
font-weight: 620;
|
|
}
|
|
|
|
.style-description {
|
|
max-width: 590px;
|
|
color: var(--muted);
|
|
font-size: 13px;
|
|
line-height: 1.45;
|
|
}
|
|
|
|
.style-row input[type="checkbox"] {
|
|
flex: none;
|
|
width: 19px;
|
|
height: 19px;
|
|
margin: 0;
|
|
accent-color: var(--accent);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.style-row input[type="checkbox"]:focus-visible {
|
|
outline: 3px solid var(--accent);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
.form-footer {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 20px;
|
|
min-height: 48px;
|
|
margin-top: 18px;
|
|
}
|
|
|
|
.form-message {
|
|
margin-bottom: 0;
|
|
color: var(--muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.form-message.error,
|
|
.inline-error { color: var(--danger); }
|
|
|
|
button {
|
|
min-height: 40px;
|
|
padding: 8px 18px;
|
|
border: 1px solid var(--accent);
|
|
border-radius: 5px;
|
|
background: var(--accent);
|
|
color: color-mix(in srgb, var(--accent) 15%, #fff);
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
}
|
|
|
|
button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 85%, #000); }
|
|
|
|
button:focus-visible {
|
|
outline: 3px solid var(--ink);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
button:disabled {
|
|
border-color: var(--line);
|
|
background: var(--line);
|
|
color: var(--muted);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.empty-state {
|
|
margin: 0;
|
|
padding: 22px 0;
|
|
border-top: 1px solid var(--line);
|
|
border-bottom: 1px solid var(--line);
|
|
color: var(--muted);
|
|
}
|
|
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
@media (max-width: 720px) {
|
|
.shell {
|
|
width: min(100% - 32px, 600px);
|
|
padding-top: 28px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 460px) {
|
|
.intro { align-items: flex-start; }
|
|
.lede { font-size: 13px; }
|
|
.selection-count strong { font-size: 19px; }
|
|
|
|
.section-heading { display: block; }
|
|
|
|
.section-heading p {
|
|
margin-top: 4px;
|
|
text-align: left;
|
|
}
|
|
|
|
.style-row {
|
|
gap: 12px;
|
|
padding-right: 6px;
|
|
}
|
|
|
|
.form-footer {
|
|
align-items: stretch;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
button { width: 100%; }
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
scroll-behavior: auto !important;
|
|
transition-duration: 0.01ms !important;
|
|
animation-duration: 0.01ms !important;
|
|
animation-iteration-count: 1 !important;
|
|
}
|
|
}
|