Accessibility: reading and color blind modes, audit fixes, calendar window
- Accessibility panel: the switch knob stays in its track; the panel follows its button in the Tab order and opens on its first switch. - Reading mode is the page as plain text: one column, no colors, pictures, cards or motion; descriptions stay in place. - Color blind mode (protanopia, deuteranopia, tritanopia, monochrome): palette swaps chosen by simulation, applied to code, data and CSS colors on public pages only. The newsletter uses the stored palette. - Audit fixes: focus not hidden by the header, focus on page change and in-page jumps, focus return for the menu, day list and people details, labelled admin fields and dialogs, keyboard map tiles, scrollable tables, and more. - Calendar asks /events for its six weeks only (?from=&to=); carousels take their 12 most recent past events (?past=12). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d067c02d33
commit
b816203c0c
45 changed files with 760 additions and 208 deletions
138
src/index.css
138
src/index.css
|
|
@ -110,6 +110,9 @@
|
|||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
/* Clear of the fixed header (Layout.tsx measures it): anything
|
||||
scrolled to, by an anchor or by keyboard focus, lands below it. */
|
||||
scroll-padding-top: calc(var(--header-h, 0px) + 1rem);
|
||||
}
|
||||
|
||||
/* An email address is one long word: let it break anywhere rather
|
||||
|
|
@ -125,6 +128,12 @@ a[href^="mailto:"] {
|
|||
outline: 2px solid var(--color-link);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
/* Not on things focused only to move the reader there (the page's
|
||||
content on a new page, a section jumped to; motion.ts, jumpTo):
|
||||
they aren't controls, and a ring round a whole section is noise. */
|
||||
[tabindex="-1"]:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Visitors who ask for less motion get no smooth scrolling, slides
|
||||
or hover zooms. */
|
||||
|
|
@ -241,39 +250,146 @@ iframe[src*="churchcenter"] {
|
|||
font-family: 'OpenDyslexic', sans-serif;
|
||||
}
|
||||
|
||||
/* Reading mode: the same content with the design stepped back. No
|
||||
background circles, motion or shadows; every layout one column,
|
||||
narrower and larger, with plain underlined links. */
|
||||
/* Reading mode: the page as plain text. One narrow column of ink on
|
||||
white (or the reverse in dark mode): no colors, backgrounds,
|
||||
cards, shadows, borders, pictures, motion or decoration, larger
|
||||
type and underlined links. A picture or video with a description
|
||||
leaves it in its place (AccessibilityPanel.tsx copies it to
|
||||
data-reading-alt on its parent). Unlayered, so it wins over the
|
||||
admin's colors (theme.js, in layers). */
|
||||
:root[data-reading="on"] {
|
||||
--color-ink: #111111;
|
||||
--color-body: #111111;
|
||||
--color-muted: #444444;
|
||||
--color-link: #111111;
|
||||
--color-brand: #111111;
|
||||
--color-action: #111111;
|
||||
--color-action-hover: #444444;
|
||||
--color-surface: #ffffff;
|
||||
--color-tint: #ffffff;
|
||||
--color-tint-soft: #ffffff;
|
||||
--color-raised: #ffffff;
|
||||
--color-danger: #111111;
|
||||
--color-danger-tint: #ffffff;
|
||||
--accent-text-mix: 100%;
|
||||
font-size: 112.5%;
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
:root[data-reading="on"] .page-backdrop {
|
||||
display: none;
|
||||
:root[data-reading="on"][data-theme="dark"] {
|
||||
--color-ink: #eeeeee;
|
||||
--color-body: #eeeeee;
|
||||
--color-muted: #bbbbbb;
|
||||
--color-link: #eeeeee;
|
||||
--color-brand: #eeeeee;
|
||||
--color-action: #eeeeee;
|
||||
--color-action-hover: #bbbbbb;
|
||||
--color-surface: #111111;
|
||||
--color-tint: #111111;
|
||||
--color-tint-soft: #111111;
|
||||
--color-raised: #111111;
|
||||
--color-danger: #eeeeee;
|
||||
--color-danger-tint: #111111;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root[data-reading="on"]:not([data-theme="light"]) {
|
||||
--color-ink: #eeeeee;
|
||||
--color-body: #eeeeee;
|
||||
--color-muted: #bbbbbb;
|
||||
--color-link: #eeeeee;
|
||||
--color-brand: #eeeeee;
|
||||
--color-action: #eeeeee;
|
||||
--color-action-hover: #bbbbbb;
|
||||
--color-surface: #111111;
|
||||
--color-tint: #111111;
|
||||
--color-tint-soft: #111111;
|
||||
--color-raised: #111111;
|
||||
--color-danger: #eeeeee;
|
||||
--color-danger-tint: #111111;
|
||||
}
|
||||
}
|
||||
/* Everything takes the page's two colors, inline styles included. */
|
||||
:root[data-reading="on"] body * {
|
||||
color: var(--color-ink) !important;
|
||||
background-color: transparent !important;
|
||||
background-image: none !important;
|
||||
border-color: transparent !important;
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
filter: none !important;
|
||||
mask-image: none !important;
|
||||
-webkit-mask-image: none !important;
|
||||
}
|
||||
:root[data-reading="on"] body,
|
||||
:root[data-reading="on"] header,
|
||||
:root[data-reading="on"] .reading-solid {
|
||||
background-color: var(--color-surface) !important;
|
||||
}
|
||||
:root[data-reading="on"] header {
|
||||
border-bottom: 1px solid var(--color-muted) !important;
|
||||
}
|
||||
:root[data-reading="on"] *,
|
||||
:root[data-reading="on"] *::before,
|
||||
:root[data-reading="on"] *::after {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
/* Pictures, video, maps and drawings go; the icons inside links and
|
||||
buttons stay, in the text color, so an icon-only button keeps
|
||||
its face. */
|
||||
:root[data-reading="on"] main :is(img, picture, video, iframe, canvas, object),
|
||||
:root[data-reading="on"] main svg:not(:is(a, button, label) svg),
|
||||
:root[data-reading="on"] .page-backdrop,
|
||||
:root[data-reading="on"] .notice::before,
|
||||
:root[data-reading="on"] .notice::after {
|
||||
display: none !important;
|
||||
}
|
||||
:root[data-reading="on"] [data-reading-alt]::after {
|
||||
content: attr(data-reading-alt);
|
||||
display: block;
|
||||
margin-block: 0.5rem;
|
||||
font-style: italic;
|
||||
}
|
||||
/* Controls keep an outline so they still read as controls. */
|
||||
:root[data-reading="on"] :is(button, input, select, textarea, .btn) {
|
||||
border: 1px solid var(--color-ink) !important;
|
||||
}
|
||||
:root[data-reading="on"] main {
|
||||
max-width: 48rem;
|
||||
max-width: 42rem;
|
||||
margin-inline: auto;
|
||||
padding-inline: 1rem;
|
||||
}
|
||||
:root[data-reading="on"] main .grid {
|
||||
grid-template-columns: minmax(0, 1fr) !important;
|
||||
}
|
||||
:root[data-reading="on"] main p,
|
||||
:root[data-reading="on"] main li {
|
||||
:root[data-reading="on"] main :is(p, li, dd) {
|
||||
line-height: 1.75;
|
||||
}
|
||||
:root[data-reading="on"] main a {
|
||||
text-decoration: underline;
|
||||
:root[data-reading="on"] a {
|
||||
text-decoration: underline !important;
|
||||
text-underline-offset: 0.2em;
|
||||
}
|
||||
|
||||
/* Color blind modes (data-vision, color.ts has the reasoning and the
|
||||
same swap for colors set from code). The palette's green family
|
||||
as variables, so CSS that uses it swaps too. */
|
||||
:root {
|
||||
--green-0: #4a7431;
|
||||
--green-1: #23361a;
|
||||
--green-2: #9cc47c;
|
||||
--green-3: #e6f0dd;
|
||||
}
|
||||
:root:is([data-vision="protanopia"], [data-vision="tritanopia"]) {
|
||||
--green-0: #9839dc;
|
||||
--green-1: #4d1575;
|
||||
--green-2: #c9a5e3;
|
||||
--green-3: #f4eef9;
|
||||
}
|
||||
/* Monochrome: the whole page in grays. On the root element a filter
|
||||
leaves fixed elements (the header, the panel) where they were. */
|
||||
:root[data-vision="monochrome"] {
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
||||
/* A notice where content would be (an empty section, a form's
|
||||
note, "coming soon"): no box and no fill, just two thick brackets
|
||||
at opposite corners, top left and bottom right, like a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue