Skip to content

Replace node-sass with sass, keeping extend#12510

Open
sabernhardt wants to merge 29 commits into
WordPress:trunkfrom
sabernhardt:replace-node-sass
Open

Replace node-sass with sass, keeping extend#12510
sabernhardt wants to merge 29 commits into
WordPress:trunkfrom
sabernhardt:replace-node-sass

Conversation

@sabernhardt

Copy link
Copy Markdown

Co-authored by @desrosj

  • Replaces node-sass with sass in package, and updates the build scripts.
  • Replaces lighten(), darken(), and mix() with the previously computed color values.
  • Creates a new mixin for non-latin fonts so the Sass can still use @extend for 76 of the 81 selectors in style.css (and style-rtl.css) and 30 of 33 selectors in style-editor.css.
  • Adds the remaining selectors below their related rulesets with the new mixin.
  • Moves comments—or changes their syntax to //—so they do not print in an unrelated place, such as
    .main-navigation {
      /* Un-style buttons */
    }
    

Trac 63013

Use of AI Tools

This is built on #12156, which involved Claude and Copilot, but I did not use AI in addition to that.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

desrosj and others added 29 commits June 11, 2026 11:25
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props desrosj, sabernhardt.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@sabernhardt

Copy link
Copy Markdown
Author

GitHub Desktop told me the compiled stylesheets changed line endings to CRLF, but I saw them as LF in my file editor. I edited the .scss files in the browser, so they should have the correct line endings.

Comment on lines +127 to +133
@mixin non-latin-fonts() {
@each $lang, $font__fallback in $font__fallbacks {
&:lang(#{$lang}) {
font-family: unquote( $font__fallback );
}
}
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could still be replaced by the language simplification and grouping, but that would fit ticket 47925 better.

Suggested change
@mixin non-latin-fonts() {
@each $lang, $font__fallback in $font__fallbacks {
&:lang(#{$lang}) {
font-family: unquote( $font__fallback );
}
}
}
@mixin non-latin-fonts() {
// Arabic
&:is(:lang(ar),:lang(ary),:lang(azb),:lang(ckb),:lang(fa),:lang(haz),:lang(ps)) {
font-family: Tahoma, Arial, sans-serif;
}
// Cyrillic
&:is(:lang(be),:lang(bg),:lang(kk),:lang(mk),:lang(mn),:lang(ru),:lang(sah),:lang(sr),:lang(tt),:lang(uk)) {
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
}
// Chinese (Hong Kong)
&:lang(zh-HK) {
font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif;
}
// Chinese (Taiwan)
&:lang(zh-TW) {
font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif;
}
// Chinese (China)
&:lang(zh-CN) {
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei New", STHeiti Light, sans-serif;
}
// Devanagari and Gujarati
&:is(:lang(bn),:lang(gu),:lang(hi),:lang(mr),:lang(ne)) {
font-family: Arial, sans-serif;
}
// Greek
&:lang(el) {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
// Hebrew
&:lang(he) {
font-family: "Arial Hebrew", Arial, sans-serif;
}
// Japanese
&:lang(ja) {
font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", Meiryo, "Helvetica Neue", sans-serif;
}
// Korean
&:lang(ko) {
font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif;
}
// Thai
&:lang(th) {
font-family: "Sukhumvit Set", "Helvetica Neue", helvetica, arial, sans-serif;
}
// Vietnamese
&:lang(vi) {
font-family: "Libre Franklin", sans-serif;
}
}

}

h2 {
@include non-latin-fonts();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non-latin fonts do not work correctly in the editor since it started using the iframe, because the iframe lacks the lang attribute, but I added the mixin for H2 headings in Cover blocks as well as the citation in a floating Pullquote block anyway.

.site-header.featured-image .entry-meta,
.site-header.featured-image .entry-title,
.site-header.featured-image#masthead .site-title a {
.site-header.featured-image .entry-title, .site-header.featured-image#masthead .site-title a {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some selectors are not on their own line, but that is quite minor.

However, if it helps, the other PR has notes for changes to the postcss.config.js file.

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.

2 participants