fix(playground): render italic text as slanted in Safari#1707
Draft
caugner wants to merge 1 commit into
Draft
Conversation
Interactive example runners load Inter as a single variable `@font-face` from `Inter.var.woff2`, which exposes a `slnt` axis (`-10` to `0`) but no `ital` axis, declared as `font-style: oblique 0deg 20deg`. Safari trusts that declaration and neither drives the slant axis from `font-style: italic` nor synthesizes an oblique, so `<em>` and other italics render upright. Explicitly set `font-variation-settings: "slnt" -10` on italic elements in the `ix-tabbed` and `ix-choice` runners so Safari slants them.
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.
🚧 Needs companion PR in mdn/dex 🚧
Description
Fix
<em>and other italics rendering upright in interactive-example runners on Safari, by explicitly driving Inter'sslntvariable-font axis for italic elements in theix-tabbedandix-choicerunners.Motivation
The runners load Inter as a single variable
@font-facefromInter.var.woff2, which exposes aslntaxis (-10to0) but noitalaxis, declared asfont-style: oblique 0deg 20deg. Safari trusts that declaration and neither drives the slant axis fromfont-style: italicnor synthesizes an oblique, so italics render upright. Chrome and Firefox slant them regardless.Additional details
/shared-assets/fonts/Inter.var.woff2has axeswght 100–900andslnt -10 → 0only.components/font/inter.cssships separate realnormal/italicfaces; the runner can't reuse those (shared-assets only hosts the single variable file).Related issues and pull requests
Fixes #1269.