Repository navigation
Fix font not applying to chat body on claude.ai and chatgpt.com - #186
Open
AliRadmanesh wants to merge 1 commit into
Open
AliRadmanesh wants to merge 1 commit into
AliRadmanesh wants to merge 1 commit into
Conversation
The [style*="font-"] guard matched inline custom properties like --font-ui-size and --_prose-font-body, so claude.ai and chatgpt.com chat bodies were excluded from the custom font. Match only font-family/font: declarations and add a regression test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On claude.ai and chatgpt.com the custom font applies to the sidebar but not to the chat body text.
Root cause
Site stylesheets exclude elements/subtrees with an author-set inline font using
:not([style*="font-"], [style*="font-"] *). That also matches inline CSS custom properties whose names containfont-:[data-cds="Prose"]hasstyle="--_prose-font-body: …", so every reply paragraph is excluded and renders inanthropic-serif.<html>/<body>have--font-ui-size: 16px, so everything under them is excluded (the released stylesheet;chatgpt.cssonmasteralready uses the precise form).Fix
Replace the guard in all
assets/styles/*.csswith:is([style*="font-family" i], [style*="font:" i])(same formchatgpt.cssalready uses), plus a unit test that forbids the broad guard, and a CHANGELOG entry.Verification
pnpm checkandnode --import tsx --test tests/unit/*.test.tspass (481 unit tests); the new test fails before the change.To try locally:
pnpm install && pnpm debug, then loadbuild/chrome-mv3-devvia chrome://extensions → Developer mode → Load unpacked.🤖 Generated with Claude Code