Repository navigation
Replace node-sass with sass, keeping extend - #12510
sabernhardt wants to merge 33 commits into
Conversation
This reverts commit bd476f6.
…rdpress-develop into replace-node-sass
…rdpress-develop into replace-node-sass
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
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 |
| @mixin non-latin-fonts() { | ||
| @each $lang, $font__fallback in $font__fallbacks { | ||
| &:lang(#{$lang}) { | ||
| font-family: unquote( $font__fallback ); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This could still be replaced by the language simplification and grouping, but that would fit ticket 47925 better.
| @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(); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
Co-Authored-By: Claude <noreply@anthropic.com>
|
I've refreshed this PR and bumped the Node version to 24. |
Co-Authored-By: Claude <noreply@anthropic.com>
|
As a minor improvement, I added the devEngines field, similar to Twenty Twenty-One. |
t-hamano
left a comment
There was a problem hiding this comment.
I ran a thorough visual regression test with the help of AI, comparing the front end with the current trunk CSS and this PR's CSS. All 310 screenshots matched pixel for pixel, so this PR should not introduce any visual regressions.
Test environment
- WordPress 7.2-alpha-64309 (PHP 8.3 built-in server + SQLite Database Integration)
- Chromium (Playwright),
deviceScaleFactor: 1, transitions and animations disabled, full-page screenshots - Content: Theme Unit Test data (
themeunittestdata.wordpress.xml) - Primary menu with a submenu, Social Links menu
- Footer widgets: Search, Recent Posts, Recent Comments, Archives, Categories, Meta, Tag Cloud, Calendar, Pages
- Local featured images (horizontal and vertical) on several posts
- External requests were blocked, so remote images in the test data were not loaded
- Comparison: exact pixel match (no threshold)
Pages (38 pages × 375px / 800px / 1200px = 114 screenshots)
/(blog home)/page/2//hello-world/(featured image header)/template-featured-image-vertical//template-comments//template-sticky//template-password-protected//markup-html-tags-and-formatting//markup-image-alignment//markup-text-alignment//block-image//block-button//block-cover//block-gallery//column-blocks//block-quotes//blocks-formatting//blocks-layout-elements//blocks-widgets//text-category-blocks//design-category-blocks//media-category-blocks//widgets-block-category//theme-block-category//wp-6-1-font-size-scale//wp-6-1-spacing-presets//post-format-chat//post-format-quote//post-format-gallery//edge-case-nested-and-mixed-lists//edge-case-many-tags//title-should-not-overflow-the-content-area//page-with-comments//page-markup-and-formatting//level-1//category/6-1/(category archive)/?s=template(search results)/?p=99999999(404)
Non-latin languages (8 pages × 12 languages × 375px / 1200px = 192 screenshots)
The lang attribute of the <html> element was changed for each language. For RTL languages, the text direction was also switched to RTL, so style-rtl.css was loaded.
Languages:
ar(RTL)he(RTL)fa-IR(RTL)jazh-CNzh-TWkoru-RUelhithvi
Pages:
//hello-world//template-comments//block-quotes//text-category-blocks//page-with-comments//?s=template/?p=99999999
Print (4 pages × 1200px = 4 screenshots)
Rendered with the print media type emulated, so print.css was applied.
//hello-world//markup-html-tags-and-formatting//template-comments/
Not covered
- Editor styles (
style-editor.css) - Hover and focus states
- Remote images from the test data
- Actual non-latin fallback fonts: fonts such as Tahoma and Hiragino Sans are not installed in the test environment, so a missing
:lang()rule might not show up in screenshots. I separately compared the compiled CSS rule by rule and confirmed that every:lang()selector in trunk also exists in this PR.
I believe this PR is ready to merge, but any additional feedback is welcome. Please let us know if there are any issues.
|
Thanks for refreshing this, @t-hamano and @sabernhardt! Building on @t-hamano's front-end screenshots, I tested the parts listed there as "Not covered": the editor styles and hover/focus states. Patch Testing ReportPatch tested: #12510 (head 64c7e80) Environment
Steps taken
Expected result
Additional Notes
|
|
Since 7.2 Beta 1 is scheduled to be released next week, I will commit this beforehand. If anyone finds any issues, please feel free to report them. |
Twenty Nineteen now compiles its stylesheets with the actively maintained `sass` package instead of the deprecated `node-sass`, which allows the theme to move to Node.js 24.x without changing the compiled CSS output. Developed in: #12510 Props adrianduffell, cyrusblake89, debarghyabanerjee, desrosj, karmatosed, rejaulalomkhan, sabernhardt, sainathpoojary, wildworks. Fixes #63013. git-svn-id: https://develop.svn.wordpress.org/trunk@64387 602fd350-edb4-49c9-b593-d223f7449a82
Twenty Nineteen now compiles its stylesheets with the actively maintained `sass` package instead of the deprecated `node-sass`, which allows the theme to move to Node.js 24.x without changing the compiled CSS output. Developed in: WordPress/wordpress-develop#12510 Props adrianduffell, cyrusblake89, debarghyabanerjee, desrosj, karmatosed, rejaulalomkhan, sabernhardt, sainathpoojary, wildworks. Fixes #63013. Built from https://develop.svn.wordpress.org/trunk@64387 git-svn-id: http://core.svn.wordpress.org/trunk@63537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Co-authored by @desrosj
node-sasswithsassin package, and updates the build scripts.lighten(),darken(), andmix()with the previously computed color values.@extendfor 76 of the 81 selectors instyle.css(andstyle-rtl.css) and 30 of 33 selectors instyle-editor.css.//—so they do not print in an unrelated place, such asTrac 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.