Skip to content

Fix Claude message typography and safely isolate inline fonts - #183

Open
seyedalida wants to merge 1 commit into
mimalef70:masterfrom
seyedalida:fix/chatbot-inline-style-font-override
Open

seyedalida wants to merge 1 commit into
mimalef70:masterfrom
seyedalida:fix/chatbot-inline-style-font-override

Conversation

@seyedalida

Copy link
Copy Markdown
Contributor

Summary

  • Safely isolate inline authored fonts in Claude stylesheet: Replace broad [style*="font-"], [style*="font-"] * selectors with :is([style*="font-family" i], [style*="font:" i]) in assets/styles/claude.css. This prevents ancestor inline style declarations containing CSS custom properties (such as --font-ui-size: 16px;) on <body> or outer wrappers from mistakenly excluding descendant readable text from FontARA font overrides.
  • Match modern Claude message blocks: Add .standard-markdown, [class*="_blocks_"], and [data-cds="Prose"] to the message selector list in claude.css so that responses rendered in Claude's updated DOM structure receive --fontara-font alongside the existing serif fallback.
  • Regression test coverage: Update browser injection regression tests to verify that chatbot stylesheets correctly apply font overrides to readable text even when ancestor elements define inline CSS variables.

Test plan

  • Run pnpm check (biome formatting, lint, typecheck, and unit tests pass cleanly).
  • Run node --test tests/browser/injection-regressions.test.mjs (all 16 Puppeteer browser tests pass).
  • Run pnpm build:all (Chrome and Firefox MV3 release packages build and validate within budget).
  • Run pnpm lint:extension (Firefox web-ext lint passes with the existing 5 allowed third-party notices).
  • Manual verification in browser: Verified that Claude message paragraphs receive custom Persian fonts (Vazirmatn) while preserving LaTeX math formulas and code blocks.

🤖 Generated with Claude Code

- Replace broad [style*="font-"] in claude.css with :is([style*="font-family" i], [style*="font:" i]) to prevent inline CSS variables like --font-ui-size on body from suppressing font application on descendant paragraphs
- Scope Claude message font overrides to .standard-markdown, [class*="_blocks_"], and [data-cds="Prose"]
- Add regression coverage for body style custom properties in browser tests

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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