Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ Known issues and notes:
- Added Google Fonts, system font, bundled font, and custom font flows.
- Added no-reload page update coverage for font changes, site toggles, profiles,
and storage updates.

- Fixed Persian/custom fonts not applying to chat body text on claude.ai,
chatgpt.com and other site stylesheets. The "author-set inline font" guard
matched any inline style containing `font-` (including CSS variables such as
`--font-ui-size` or `--_prose-font-body`), which excluded entire page
subtrees. It now only matches real `font-family` / `font:` declarations.
4 changes: 2 additions & 2 deletions assets/styles/aistudio.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
ms-cmark-node *,
textarea
):not(
[style*="font-"],
[style*="font-"] *,
:is([style*="font-family" i], [style*="font:" i]),
:is([style*="font-family" i], [style*="font:" i]) *,
pre,
pre *,
code,
Expand Down
8 changes: 4 additions & 4 deletions assets/styles/claude.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
body,
html
):not(
[style*="font-"],
[style*="font-"] *,
:is([style*="font-family" i], [style*="font:" i]),
:is([style*="font-family" i], [style*="font:" i]) *,
pre,
pre *,
code,
Expand Down Expand Up @@ -126,8 +126,8 @@
legend,
[role="heading"]
):not(
[style*="font-"],
[style*="font-"] *,
:is([style*="font-family" i], [style*="font:" i]),
:is([style*="font-family" i], [style*="font:" i]) *,
pre,
pre *,
code,
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/duckduckgo.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ body :where(
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/facebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body :where(
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
4 changes: 2 additions & 2 deletions assets/styles/gemini.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ body :where(
[role="option"],
[role="tab"]
):not(
[style*="font-"],
[style*="font-"] *,
:is([style*="font-family" i], [style*="font:" i]),
:is([style*="font-family" i], [style*="font:" i]) *,
pre,
pre *,
code,
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/google.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/instagram.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/linkedin.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
4 changes: 2 additions & 2 deletions assets/styles/notebooklm.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
.mat-tonal-button,
.query-box-input
):not(
[style*="font-"],
[style*="font-"] *,
:is([style*="font-family" i], [style*="font:" i]),
:is([style*="font-family" i], [style*="font:" i]) *,
pre,
pre *,
code,
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/trello.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ body :where(
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/wikipedia.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body :where(
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/x.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ body {
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/youtube.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ body :where(
.fasr,
.fat,
.icofont,
[style*="font-"],
:is([style*="font-family" i], [style*="font:" i]),
[class*="icon"],
[class*="Icon"],
[class*="symbol"],
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/site-css.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,17 @@ test("ChatGPT CSS targets the mobile composer without StyleX hashes", () => {
assert.match(css, /(?:^|,\s*)form\[data-mobile-composer\]\s*(?:,|\{)/m)
assert.doesNotMatch(css, /(^|[\s,])\.x[a-z\d]+\b/)
})

test("site CSS only treats real inline font declarations as author-set fonts", () => {
// `[style*="font-"]` also matches CSS custom properties such as
// `--_prose-font-body: ...` (claude.ai) and excludes the whole subtree.
for (const fileName of getSiteStyleFiles()) {
const css = fs.readFileSync(path.join(SITE_STYLES_DIR, fileName), "utf8")

assert.doesNotMatch(
css,
/\[style\*="font-"/,
`${fileName} uses the broad [style*="font-"] guard; match font-family/font: instead`
)
}
})