Skip to content

fix(core): render italic text correctly in Safari - #17

Merged
monospaced merged 1 commit into
mainfrom
fix-safari-italics
Jul 30, 2026
Merged

fix(core): render italic text correctly in Safari#17
monospaced merged 1 commit into
mainfrom
fix-safari-italics

Conversation

@monospaced

Copy link
Copy Markdown
Owner

Problem

<em> and other italics rendered upright in Safari (Chrome and Firefox were fine). The element was present — just not slanted.

Root cause: italic in Set is the variable font's slant axis, triggered by font-style: italic. WebKit drops the font-style: italic → slant-axis mapping once font-variation-settings is set (which .set does), and font-synthesis: none blocks the faux fallback — so the slant never applies.

Fix

A new fontVariationSettings.italic token declares the slnt axis explicitly so WebKit can't drop it:

  • mnsp / Berkeley Mono: slnt -16
  • wrfr / Recursive: CRSV 1, CASL 1, MONO 1, slnt -15

Applied to:

  • :where(address, cite, dfn, em, i, var) in root.css
  • prose code italics (.hljs-comment, .hljs-emphasis)

font-weightwght is unaffected by the WebKit bug, so bold-italic still gets its weight.

Docs

  • Font variation settings section is now per-token: default → "No change" (inert on mnsp), italic → a live <em> specimen.
  • Reworded the inert-token marker from "Not used" → "No change" (these tokens are applied — their mnsp values are just a no-op — and do real work on wrfr). Renamed the helper/class accordingly (renderInertPreview / .value-text-inert); the effect filter marker uses the same.

Release

Changeset: minor across the fixed group — it's a fix, but it adds the public --set-typography-font-variation-settings-italic token.

🤖 Generated with Claude Code

WebKit drops the font-style:italic -> slant-axis mapping once
font-variation-settings is set, leaving italics upright in Safari
(Chrome/Firefox were unaffected). Add a fontVariationSettings.italic
token that declares the slant axis explicitly and apply it to italic
elements and prose code italics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploy Preview for setds ready!

Name Link
🔨 Latest commit f31775a
🔍 Latest deploy log https://app.netlify.com/projects/setds/deploys/6a6ba3aa4beffa000855caff
😎 Deploy Preview https://deploy-preview-17--setds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@monospaced
monospaced merged commit fe48043 into main Jul 30, 2026
15 checks passed
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.

1 participant