Files
poli0981andClaude Fable 5.2 7511f0c45e fix(a11y): findings from an independent review of the branch
Regressions from this branch: overflow-wrap anywhere broke words inside the AI-usage table (break-word now, with minmax(0, 1fr) grid columns so the legal layout can still shrink); the legal notice kept covering footer controls between 768 and about 1100px (the body makes room for it at every width); the home link was a 32x12px mark once the wordmark was hidden (it keeps a 40px box); the sitemap filter dropped any path containing an admin segment (anchored to the host root); prefers-contrast did not reach the sepia reader theme.

Older bugs the new statement made claims about: Tab could leave the search dialog once results were listed, because the trap counted the tabindex=-1 options; and the half of a legal page that is not in the page's language had no lang (each half is wrapped at build time, src/lib/legal-lang.ts).

Found by the wider reflow sweep: the album photo grid used 1fr columns, which grew past a 320px screen.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 08:27:12 +07:00

212 lines
5.0 KiB
CSS

/* Long-form text (blog posts, story chapters, legal pages): src/components/Prose.astro wraps
content in .prose, and the admin editor's preview frame renders with the same rules. */
.prose {
--measure: 65ch;
max-inline-size: var(--measure);
font-family: var(--ff-reading);
font-size: var(--text-body);
line-height: 1.7;
color: var(--text);
/* A bare URL or an e-mail address is one unbreakable word: on a 320px screen it pushed
the page wider than the viewport. Break inside such words only when nothing else fits.
`break-word`, not `anywhere`: the latter also lets a table shrink its columns below
their longest word, which broke "Anthropic" across two lines in the AI-usage table. */
overflow-wrap: break-word;
}
.prose--reader {
--measure: 68ch;
/* --reader-fs is set by ReadingControls on the reader container and inherits here. */
font-size: var(--reader-fs, clamp(1.125rem, 1.05rem + 0.32vw, 1.25rem));
}
.prose > * + * {
margin-block-start: 1em;
}
/* The legal pages wrap each language half in a container that carries `lang`
(src/lib/legal-lang.ts). It takes no box of its own, so the rhythm rule above has to
reach through it; :where() keeps the specificity of that rule, so the heading margins
below still win. */
.prose > [lang] {
display: contents;
}
.prose > :where([lang]) > * + *,
.prose > :where(* + [lang]) > :where(:first-child) {
margin-block-start: 1em;
}
.prose h2,
.prose h3,
.prose h4 {
font-family: var(--ff-display);
line-height: 1.2;
margin-block-start: 1.8em;
text-wrap: balance;
}
.prose h2 {
font-size: var(--text-h3);
}
.prose h3 {
font-size: var(--text-lead);
}
.prose a {
color: var(--accent);
text-decoration: underline;
text-underline-offset: 0.15em;
text-decoration-thickness: 1px;
text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose a:hover {
text-decoration-color: var(--accent);
}
.prose strong {
color: var(--text);
font-weight: 600;
}
.prose blockquote {
margin-inline: 0;
padding-inline-start: 1.1em;
border-inline-start: 2px solid var(--accent);
color: var(--muted);
font-style: italic;
}
.prose ul,
.prose ol {
padding-inline-start: 1.4em;
}
/* Tailwind's preflight strips list markers everywhere; long-form text wants them back. */
.prose ul {
list-style: disc;
}
.prose ol {
list-style: decimal;
}
.prose li::marker {
color: var(--muted);
}
.prose img {
max-inline-size: 100%;
block-size: auto;
border-radius: var(--radius-card);
border: 1px solid var(--line);
}
.prose hr {
border: none;
border-block-start: 1px solid var(--line);
margin-block: 2em;
}
.prose :not(pre) > code {
font-family: var(--ff-mono);
font-size: 0.9em;
background: var(--surface);
border: 1px solid var(--line);
border-radius: 4px;
padding: 0.1em 0.35em;
}
.prose pre {
font-family: var(--ff-mono);
font-size: 0.9em;
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--radius-card);
padding: 1em 1.1em;
overflow-x: auto;
line-height: 1.6;
}
.prose pre code {
background: none;
border: none;
padding: 0;
}
/* Prism token theme (class-based → CSP-clean). */
.prose .token.comment,
.prose .token.prolog,
.prose .token.doctype,
.prose .token.cdata {
color: var(--muted);
font-style: italic;
}
.prose .token.punctuation {
color: var(--muted);
}
.prose .token.keyword,
.prose .token.selector,
.prose .token.important,
.prose .token.atrule {
color: var(--accent);
}
.prose .token.string,
.prose .token.attr-value,
.prose .token.char,
.prose .token.regex {
color: var(--ok);
}
.prose .token.function,
.prose .token.class-name {
color: var(--accent-strong);
}
.prose .token.number,
.prose .token.boolean,
.prose .token.constant {
color: var(--warn);
}
.prose .token.tag,
.prose .token.property,
.prose .token.attr-name,
.prose .token.symbol {
color: var(--text);
}
.prose .token.operator,
.prose .token.entity,
.prose .token.url {
color: var(--muted);
}
/* Callout (src/components/Callout.astro) — used from MDX content, so its rules live here. */
.callout {
display: flex;
gap: 0.75rem;
padding: 0.9rem 1rem;
border-radius: var(--radius-card);
border: 1px solid var(--line);
background: var(--surface);
font-family: var(--ff-body);
font-size: var(--text-body);
}
.callout-icon {
flex: none;
inline-size: 1.5rem;
block-size: 1.5rem;
display: grid;
place-items: center;
border-radius: 999px;
font-family: var(--ff-mono);
font-weight: 700;
font-size: 0.85rem;
color: var(--bg);
}
.callout-title {
font-weight: 600;
margin-block-end: 0.25rem;
}
.callout-body > * + * {
margin-block-start: 0.5em;
}
.callout.info {
border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.callout.info .callout-icon {
background: var(--accent);
}
.callout.tip {
border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
}
.callout.tip .callout-icon {
background: var(--ok);
}
.callout.warn {
border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
}
.callout.warn .callout-icon {
background: var(--warn);
}