Skip to content

fix(eink): make Custom Fonts panel readable in e-ink mode (#4454) - #4464

Merged
chrox merged 1 commit into
mainfrom
fix/eink-custom-font-selected-readability
Jun 4, 2026
Merged

fix(eink): make Custom Fonts panel readable in e-ink mode (#4454)#4464
chrox merged 1 commit into
mainfrom
fix/eink-custom-font-selected-readability

Conversation

@chrox

@chrox chrox commented Jun 4, 2026

Copy link
Copy Markdown
Member

Problem

On e-ink devices the Custom Fonts settings panel had two unreadable spots:

  1. Selected font card — the selected family showed black text on a black fill (issue Eink - The selected Custom Font is not readable #4454). The card uses bg-primary/50, and the /50 opacity suffix produces the class bg-primary\/50, which the exact [data-eink] .bg-primary normalizer selector never matches. So the dark primary fill survived while text-base-content was forced black → black-on-black.

  2. Import Font "+" badge — the "+" glyph rendered black on a black circle. E-ink's substring matchers ([class*='bg-base-content'], [class*='text-base-content']) catch the badge's group-hover:bg-base-content and text-base-content/60 utilities and force both the circle and glyph to base-content.

Fix

  • Add eink-bordered to the selected card so it routes through the same white-bg / black-border / black-text treatment every other primary-selected surface gets in e-ink — readable, and still distinct from the faint-bordered unselected cards.
  • Pin the Import badge to an intentional base-content circle + base-100 glyph via a dedicated import-font-add-badge hook in globals.css, so the "+" contrasts against the dark circle.

Normal (color) mode is unchanged — both rules are scoped to [data-eink='true'].

Verification

Confirmed against the live compiled stylesheet in the real component under e-ink mode:

  • Selected card → white bg oklch(1 0 0), black border + text oklch(0.20 0 0).
  • Import badge → black circle oklch(0.20 0 0), white "+" oklch(1 0 0).

pnpm lint passes.

Closes #4454

🤖 Generated with Claude Code

The selected custom-font card used `bg-primary/50`, whose opacity suffix
dodges the e-ink `.bg-primary` normalizer — leaving a dark primary fill
under force-black `text-base-content` text, i.e. black-on-black (#4454).
Add `eink-bordered` so the selected card gets the same white-bg /
black-border / black-text treatment every other selected surface gets,
while staying distinct from the faint-bordered unselected cards.

The Import Font "+" badge had the same class of bug: e-ink's substring
matchers catch its `group-hover:bg-base-content` and `text-base-content/60`
utilities and paint a black glyph on a black circle. Pin the badge to an
intentional base-content circle with a base-100 glyph so the "+" stays
legible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chrox
chrox force-pushed the fix/eink-custom-font-selected-readability branch from 3160c07 to aaeb4ef Compare June 4, 2026 16:23
@chrox
chrox merged commit b07c9eb into main Jun 4, 2026
8 checks passed
@chrox
chrox deleted the fix/eink-custom-font-selected-readability branch June 4, 2026 16:28
dalzyu added a commit to dalzyu/readest-hermes that referenced this pull request Jun 18, 2026
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.

Eink - The selected Custom Font is not readable

1 participant