fix(core): render italic text correctly in Safari - #17
Merged
Conversation
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>
✅ Deploy Preview for setds ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
<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 thefont-style: italic→ slant-axis mapping oncefont-variation-settingsis set (which.setdoes), andfont-synthesis: noneblocks the faux fallback — so the slant never applies.Fix
A new
fontVariationSettings.italictoken declares theslntaxis explicitly so WebKit can't drop it:slnt -16CRSV 1, CASL 1, MONO 1, slnt -15Applied to:
:where(address, cite, dfn, em, i, var)inroot.css.hljs-comment,.hljs-emphasis)font-weight→wghtis unaffected by the WebKit bug, so bold-italic still gets its weight.Docs
default→ "No change" (inert on mnsp),italic→ a live<em>specimen.renderInertPreview/.value-text-inert); the effectfiltermarker uses the same.Release
Changeset: minor across the fixed group — it's a fix, but it adds the public
--set-typography-font-variation-settings-italictoken.🤖 Generated with Claude Code