Skip to content

Add: dyslexia-friendly reading font - #14

Merged
Varnasr merged 4 commits into
mainfrom
claude/dyslexic-font-integration-2bboev
Sep 15, 2026
Merged

Varnasr merged 4 commits into
mainfrom
claude/dyslexic-font-integration-2bboev

Conversation

@Varnasr

@Varnasr Varnasr commented Sep 15, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Adds a dyslexia-friendly reading font behind an Aa button. The app has no bar to put a control in, since ThemeToggle is itself a fixed button, so this one takes the bottom-left corner.

OpenDyslexic by Abbie Gonzalez (font version 0.920, packaged as @fontsource/opendyslexic 5.3.0), SIL Open Font License 1.1, self-hosted. The module and the four faces go in public/, which Vite copies to the build root, so the tag in index.html is root-absolute and correct in the built app.

Nothing downloads until the button is pressed, because a browser fetches a @font-face only once a rule using that family matches a rendered element. The switch also opens up letter, word and line spacing, which is the half with the better evidence: Zorzi et al. (PNAS 109(28), 2012) found extra letter spacing raised reading speed and halved errors in children with dyslexia, with no training, while Kuster et al. (Annals of Dyslexia, 2018) found Dyslexie gave no benefit over Arial.

The button takes --accent-primary, the amber this app already uses, for its "on" outline and wash.

package-lock.json is deliberately not committed and is now gitignored: it was generated by the verification build and this repository has never tracked one.

Type of change

  • Bug fix (broken link, layout, JS error)
  • New content (course, case study, translation)
  • New feature or tool
  • Accessibility improvement
  • Performance improvement
  • Documentation update

Checklist

  • Tested on desktop browser — against a real production build (npm run build, served from build/), both colour schemes: zero font requests in the default state, 200s once the class lands
  • Tested on mobile browser — not done, no device in this environment
  • No console errors
  • Links are working

🤖 Generated with Claude Code

https://claude.ai/code/session_01B2G8v4sBXZZHayZqhAeGgb


Generated by Claude Code

OpenDyslexic by Abbie Gonzalez (font version 0.920, packaged as
@fontsource/opendyslexic 5.3.0), SIL Open Font License 1.1, self-hosted.
The module and the four faces go in public/, which Vite copies to the
build root, so the tag in index.html is root-absolute and correct in the
built app.

The app has no bar to put the control in -- ThemeToggle is itself a
fixed button -- so the "Aa" button takes the bottom-left corner. Nothing
downloads until it is pressed: a browser fetches a @font-face only once
a rule using that family matches a rendered element. Verified against a
real production build (npm run build, served from build/): zero font
requests in the default state, 200s and a computed family of
OpenDyslexic once the class lands.

The switch also opens up letter, word and line spacing, the half with
the better evidence (Zorzi et al., PNAS 109(28), 2012, found extra
letter spacing raised reading speed and halved errors in children with
dyslexia, with no training; Kuster et al., Annals of Dyslexia, 2018,
found Dyslexie gave no benefit over Arial).

package-lock.json is deliberately not committed: it was generated by the
verification build and the repository has never tracked one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2G8v4sBXZZHayZqhAeGgb
On two of the sibling sites .theme-toggle is the <button> itself rather
than a container, so the module would have appended a button inside a
button -- invalid markup that the parser reparents, putting the control
somewhere nobody chose. host() now takes the parent row when the match
is a BUTTON, A, INPUT, LABEL or SELECT, and also recognises
.theme-toggle-group and .themebar, which two of these sites use. No
effect here, where the app has no bar and the button stays in the
corner, but the module is the same file in every repository.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2G8v4sBXZZHayZqhAeGgb
It was generated by the build I ran to verify the reading-font change and
the pre-commit hook staged it, against what the previous commit message
said. The repository has never tracked a lockfile and this change is no
reason to start; 2,813 lines of dependency graph do not belong in it.
Ignored so the next person running npm install does not re-add it by
accident.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2G8v4sBXZZHayZqhAeGgb
data-accent on the script tag points at --accent-primary, the amber this
app already uses, so the button takes the site's colour rather than a
neutral blue, and follows the app's own theme because a var() resolves
where it is used rather than where it is declared.

"On" is that accent as an outline over a 16% wash of itself, with the
label left at the surrounding ink. Filling the button instead needs an
ink that clears 4.5:1 against whatever the accent is, and these sites
swap accents between themes; leaving the ink alone cannot go wrong.
Checked in headless Chromium in both colour schemes against a real
production build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B2G8v4sBXZZHayZqhAeGgb
@Varnasr
Varnasr merged commit 616dbc7 into main Sep 15, 2026
1 check passed
@Varnasr
Varnasr deleted the claude/dyslexic-font-integration-2bboev branch September 15, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants