Repository navigation
Replace $default-font with the font family body token - #87490
Conversation
Swap call sites of the `$default-font` Sass variable from `@wordpress/base-styles` for `var(--wpds-typography-font-family-body)`, and extend the Stylelint rule for the font family variables to reject `$default-font` too. The variable definition stays unchanged until its deprecation.
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +209 B (0%) Total Size: 8.85 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to create a navigation overlay for a specific navigation block in
|
ciampo
left a comment
There was a problem hiding this comment.
LGTM 🚀
Just a heads-up about this PR needing a rebase which may not be straighforward, making sure that all CHANGELOG entries are moved to the new Unreleased section and that the new color changes from #87817 are preserved in Tooltip
What?
Follow-up to #86761.
Replaces the uses of the
$default-fontSass variable from@wordpress/base-styleswith the--wpds-typography-font-family-bodydesign token, and extends the Stylelint rule for the font family variables to reject$default-fontin declaration values too.Why?
$default-fontis an alias of$font-family-body, which #86761 already replaced with the token. Moving its call sites now, and preventing new ones, prepares for deprecating the variable. The variable itself stays in@wordpress/base-stylesuntil then.How?
The
input-controlmixin in@wordpress/base-stylesuses the package'swpds.var()helper instead of a barevar(), like the other token references in that file, because stylesheets built outside Gutenberg do not get the token fallbacks that the Gutenberg build adds.Testing Instructions
Snackbar,Placeholder, and@wordpress/componentsTooltip(Components/@wordpress-components/Deprecated/Tooltip) stories and check that the text renders in the system font as before.font-family: $default-font;to any stylesheet and runnpm run lint:css. It reports an error that suggestsvar(--wpds-typography-font-family-body).Screenshots or screencast
The token value matches the Sass variable, so the components render the same as before.