跳到内容
新问题

有关于这个项目的问题吗?注册一个免费的GitHub帐户以打开一个问题,并联系其维护者和社区。

单击“注册GitHub”,表示您同意我们的服务条款隐私声明。我们偶尔会向您发送与帐户相关的电子邮件。

已经在GitHub上了?登录到您的帐户

样式:尝试使用:root换行以修复重置样式 #61638

已合并
将32个提交合并到
2024年5月28日

对话

埃拉特里克斯
复制链接
成员

@埃拉特里克斯 埃拉特里克斯 评论2024年5月14日

什么?

为了应用全局样式之后任何主题重置样式,例如。ol,ul{…},增加特异性轻微地,同时保持CSS总体特异性水平和特异性降低。

要做的:弄清楚我们到底还需要什么:根,我对这个代码不是很熟悉。

注:块样式变化及其选择器将通过单独的随访进行处理,因为它们尚未在古腾堡合并其特异性降低(参见#61032).

为什么?

确保重置样式未包装:其中不要打破任何东西。

为什么?:根而不是html格式身体? 因为:根具有相同的属性特异性,可以捕获所有类型的重置样式,包括具有属性的重置样式(例子).

怎么用?

将我们所有的特异性标准化/水平化规则包装在:根,以便在这些重置样式之后运行。

测试说明

我们仅有的单元测试涵盖了样式的生成,而不是它们的应用程序,因此我们将不得不依赖一些手动测试或添加新的测试。感谢您的帮助!:)

手动测试

  • 激活emptytheme
  • 将所有块添加到两个编辑器中的文章或页面,确保它们正确显示并应用块库样式
  • 切换到切换编辑器并为每个块应用全局样式,检查这些样式是否在编辑器和前端都有效
  • 测试各种经典主题,确保块在前端或编辑器中获得所有正确的样式

键盘测试说明

屏幕截图或屏幕广播

@埃拉特里克斯 埃拉特里克斯补充全球风格 与更广泛的Global Styles工作相关的任何内容,包括Styles Engine和theme.json CSS样式 与编辑器和前端样式、CSS特定问题相关。标签2024年5月14日
复制链接

github-操作 机器人程序 评论2024年5月14日

此请求已更改或添加PHP文件。请确认是否需要将这些更改同步到WordPress Core,以便在下一版本的WordPres中使用。

如果是,建议创建一个新Trac票并向WordPress核心Github存储库在合并此拉取请求之后不久。

如果您不确定,可以随时在中的#core-editor频道寻求帮助WordPress松弛.

谢谢您!❤️

查看更改的文件
lib/class-wp-theme-json-gutenberg.php
lib/theme.json文件
phpunit/class-wp-theme-json测试.php

复制链接
贡献者

@告诉机器 告诉机器 留下了评论

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

谢谢你的公关!

就特异性而言,:根与类名完全相同,因此此更改有效地撤消了#60106.我认为如果这是我们想要做的#60106是更好的解决方案,因为它将保留更简单、更语义化的类名选择器。

另一件需要记住的事是,如果我们恢复全局样式的特定性,我们将需要恢复#60228同样,因为布局选择器的减少取决于全局样式。

我没有足够的背景知识来解释为什么需要进行这一改变,因此,如果能对这篇公关文章进行更全面的描述,或者链接到某个问题,我将不胜感激!

复制链接

github-操作 机器人程序 评论2024年5月14日

尺寸变化:-1.22 kB(-0.07%)

总大小:1.74 MB

文件名 大小 更改
构建/块编辑器/index.min.js 260千字节 +31亿(+0.01%)
build/block-editor/style-rtl.css 15.5千字节 +14亿(+0.09%)
构建/块编辑器/样式.css 15.5千字节 +16亿(+0.1%)
构建/block-library/blocks/audio/theme-rtl.css 126亿 -70亿(-5.26%)
构建/block-library/blocks/audio/theme.css 126亿 -70亿(-5.26%)
build/block-library/blocks/button/editor-rtl.css 307亿 -108亿(-26.02%) 🎉
build/block-library/blocks/button/editor.css 307亿 -107亿(-25.85%) 🎉
build/block-library/blocks/button/style-rtl.css 539亿 -88亿(-14.04%) 👏
build/block-library/blocks/button/style.css 539亿 -87亿(-13.9%) 👏
build/block-library/blocks/cover/style-rtl.css 1.67千字节 -31亿(-1.82%)
build/block-library/blocks/cover/style.css 1.66千字节 -31亿(-1.83%)
build/block-library/blocks/embed/theme-rtl.css 126亿 -7亿(-5.26%)
build/block-library/blocks/embed/theme.css 126亿 -70亿(-5.26%)
build/block-library/blocks/galletry/editor-rtl.css 962亿 +6亿(+0.63%)
build/block-library/blocks/galletry/editor.css 965亿 +5亿(+0.52%)
build/block-library/blocks/image/style-rtl.css 1.52千字节 -77亿(-4.82%)
build/block-library/blocks/image/style.css 1.52千字节 -75亿(-4.71%)
构建/block-library/blocks/image/theme-rtl.css 137亿 +4 B(+3.01%)
构建/block-library/blocks/image/theme.css 137亿 +4亿(+3.01%)
build/block-library/blocks/platest-posts/editor-rtl.css 207亿 -6亿(-2.82%)
构建/块库/blocks/latest posts/editor.css 206亿 -6亿(-2.83%)
build/block-library/blocks/platest-posts/style-rtl.css 513亿 +19亿(+3.85%)
build/block-library/blocks/platest-posts/style.css 513亿 +19亿(+3.85%)
build/block-library/blocks/list/style-rtl.css 102亿 +14亿(+15.91%) ⚠️
build/block-library/blocks/list/style.css 102亿 +14亿(+15.91%) ⚠️
build/block-library/blocks/pragment/style-rtl.css 341亿 +6亿(+1.79%)
build/block-library/blocks/pragment/style.css 341亿 +6亿(+1.79%)
build/block-library/blocks/pullquote/style-rtl.css 344亿 -10亿(-2.82%)
build/block-library/blocks/pullquote/style.css 343亿 -10亿(-2.83%)
build/block-library/blocks/pullquote/theme-rtl.css 168亿 -6亿(-3.45%)
构建/block-library/blocks/pullquote/theme.css 168亿 -6亿(-3.45%)
build/block-library/blocks/quote/theme-rtl.css 223亿 -10亿(-4.29%)
构建/block-library/blocks/quote/theme.css 226亿 -9亿(-3.83%)
build/block-library/blocks/seleparator/editor-rtl.css 99亿 -47亿(-32.19%) 🎉
build/block-library/blocks/seleparator/editor.css 99亿 -47亿(-32.19%) 🎉
build/block-library/blocks/seleparater/style-rtl.css 243亿 +4 B(+1.67%)
build/block-library/blocks/seleparater/style.css 243亿 +4亿(+1.67%)
build/block-library/blocks/site-logo/style-rtl.css 218亿 +14亿(+6.86%) 🔍
build/block-library/blocks/site-logo/style.css 218亿 +14亿(+6.86%) 🔍
build/block-library/blocks/site-title/editor-rtl.css 124亿 +80亿(+6.9%) 🔍
build/block-library/blocks/site-title/editor.css 124亿 +80亿(+6.9%) 🔍
build/block-library/blocks/site-title/style-rtl.css 70亿 +13亿(+22.81%) 🚨
build/block-library/blocks/site-title/style.css 70亿 +13亿(+22.81%) 🚨
build/block-library/blocks/social-link/editor-rtl.css 335亿 +11亿(+3.4%)
build/block-library/blocks/social-link/editor.css 335亿 +11亿(+3.4%)
build/block-library/blocks/social-links/editor-rtl.css 683亿 +7亿(+1.04%)
build/block-library/blocks/social-links/editor.css 681亿 +6亿(+0.89%)
build/block-library/blocks/social-links/style-rtl.css 1.51千字节 +15亿(+1%)
build/block-library/blocks/social-links/style.css 1.51千字节 +15亿(+1%)
build/block-library/blocks/table/theme-rtl.css 146亿 -6亿(-3.95%)
构建/block-library/blocks/table/theme.css 146亿 -6亿(-3.95%)
build/block-library/blocks/tag-cloud/style-rtl.css 265亿 +14亿(+5.58%) 🔍
build/block-library/blocks/tag-cloud/style.css 266亿 +13亿(+5.14%) 🔍
build/block-library/blocks/template-part/theme-rtl.css 112亿 +5亿(+4.67%) 🔍
build/block-library/blocks/template-part/theme.css 112亿 +5亿(+4.67%) 🔍
构建/block-library/blocks/video/theme-rtl.css 126亿 -70亿(-5.26%)
build/block-library/blocks/video/theme.css 126亿 -70亿(-5.26%)
build/block-library/editor-rtl.css 12.1千字节 -105亿(-0.86%)
build/block-library/editor.css 12.1千字节 -102亿(-0.83%)
build/block-library/style-rtl.css 14.6千字节 -176亿(-1.19%)
build/block-library/style.css 14.6千字节 -172亿(-1.16%)
构建/块-库/theme-rtl.css 703亿 -4亿(-0.57%)
构建/块-库/theme.css 706亿 -7亿(-0.98%)
build/edit-site/index.min.js 213千字节 -178亿(-0.08%)
ℹ️查看未更改
文件名 大小
构建/a11y/index.min.js 955亿
build/annotations/index.min.js 2.27千字节
构建/api-fetch/index.min.js 2.32千字节
构建/auto/index.min.js 2.1千字节
build/blob/index.min.js 578亿
build/block-directory/index.min.js 7.29千字节
构建/块目录/样式-rtl.css 1.03千字节
构建/块目录/样式.css 1.03千字节
build/block-editor/content-rtl.css 4.58千字节
构建/块编辑器/内容.css 4.57千字节
构建/块编辑器/默认编辑器样式-rtl.css 395亿
构建/块编辑器/默认编辑器样式.css 395亿
build/block-library/blocks/archives/editor-rtl.css 61亿
build/block-library/blocks/archives/editor.css 60亿
build/block-library/blocks/archives/style-rtl.css 90亿
build/block-library/blocks/archives/style.css 90亿
build/block-library/blocks/audio/editor-rtl.css 150亿
build/block-library/blocks/audio/editor.css 150亿
build/block-library/blocks/audio/style-rtl.css 122亿
build/block-library/blocks/audio/style.css 122亿
build/block-library/blocks/avatar/editor-rtl.css 116亿
build/block-library/blocks/avatar/editor.css 116亿
build/block-library/blocks/avatar/style-rtl.css 104亿
build/block-library/blocks/avatar/style.css 104亿
build/block-library/blocks/block/editor-rtl.css 277亿
build/block-library/blocks/block/editor.css 277亿
build/block-library/blocks/buttons/editor-rtl.css 337亿
build/block-library/blocks/buttons/editor.css 337亿
build/block-library/blocks/buttons/style-rtl.css 332亿
build/block-library/blocks/buttons/style.css 332亿
build/block-library/blocks/calendar/style-rtl.css 239亿
build/block-library/blocks/calendar/style.css 239亿
build/block-library/blocks/categories/editor-rtl.css 113亿
build/block-library/blocks/categories/editor.css 112亿
build/block-library/blocks/categories/style-rtl.css 124亿
build/block-library/blocks/categories/style.css 124亿
build/block-library/blocks/code/editor-rtl.css 53亿
build/block-library/blocks/code/editor.css 53亿
build/block-library/blocks/code/style-rtl.css 121亿
build/block-library/blocks/code/style.css 121亿
build/block-library/blocks/code/theme-rtl.css 124亿
build/block-library/blocks/code/theme.css 124亿
build/block-library/blocks/columns/editor-rtl.css 108亿
build/block-library/blocks/columns/editor.css 108亿
build/block-library/blocks/columns/style-rtl.css 421个B
build/block-library/blocks/columns/style.css 421个B
build/block-library/blocks/comment-author-avatar/editor-rtl.css 125亿
build/block-library/blocks/comment-author-avatar/editor.css 125亿
build/block-library/blocks/comment-content/style-rtl.css 92亿
build/block-library/blocks/comment-content/style.css 92亿
build/block-library/blocks/comment-template/style-rtl.css 199亿
build/block-library/blocks/comment-template/style.css 198亿
build/block-library/blocks/comments-pagination-numbers/editor-rtl.css 123亿
build/block-library/blocks/comments-pagination-numbers/editor.css 121亿
build/block-library/blocks/comments-pagination/editor-rtl.css 222亿
build/block-library/blocks/comments-pageination/editor.css 209亿
build/block-library/blocks/comments-pagination/style-rtl.css 235亿
build/block-library/blocks/comments-pageination/style.css 231亿
build/block-library/blocks/comments-title/editor-rtl.css 75亿
build/block-library/blocks/comments-title/editor.css 75亿
build/block-library/blocks/comments/editor-rtl.css 840亿
build/block-library/blocks/comments/editor.css 839亿
build/block-library/blocks/comments/style-rtl.css 637亿
build/block-library/blocks/comments/style.css 636亿
构建/块库/blocks/cover/editor-rtl.css 671亿
build/block-library/blocks/cover/editor.css 674亿
build/block-library/blocks/details/editor-rtl.css 65亿
build/block-library/blocks/details/editor.css 65亿
build/block-library/blocks/details/style-rtl.css 86亿
构建/块库/blocks/details/style.css 86亿
build/block-library/blocks/embed/editor-rtl.css 312磅
build/block-library/blocks/embed/editor.css 312磅
build/block-library/blocks/embed/style-rtl.css 410亿
build/block-library/blocks/embed/style.css 410亿
build/block-library/blocks/file/editor-rtl.css 326亿
build/block-library/blocks/file/editor.css 327亿
build/block-library/blocks/file/style-rtl.css 280亿
build/block-library/blocks/file/style.css 281亿
build/block-library/blocks/file/view.min.js 324亿
build/block-library/blocks/footnotes/style-rtl.css 201亿
build/block-library/blocks/footnotes/style.css 199亿
build/block-library/blocks/form-input/editor-rtl.css 227亿
build/block-library/blocks/form-input/editor.css 227亿
build/block-library/blocks/form-input/style-rtl.css 343亿
build/block-library/blocks/form-input/style.css 343亿
build/block-library/blocks/form-submission-notification/editor-rtl.css 340亿
build/block-library/blocks/form-submission-notification/editor.css 340亿
build/block-library/blocks/form-submit-button/style-rtl.css 69亿
build/block-library/blocks/form-submit-button/style.css 69亿
build/block-library/blocks/form/view.min.js 471亿
build/block-library/blocks/freeform/editor-rtl.css 2.61千字节
build/block-library/blocks/freeform/editor.css 2.61千字节
build/block-library/blocks/gallower/style-rtl.css 1.72千字节
build/block-library/blocks/gallower/style.css 1.72千字节
build/block-library/blocks/gallower/theme-rtl.css版本 108亿
build/block-library/blocks/gallery/主题.css 108亿
build/block-library/blocks/group/editor-rtl.css 403亿
build/block-library/blocks/group/editor.css 403亿
build/block-library/blocks/group/style-rtl.css 103亿
build/block-library/blocks/group/style.css 103亿
构建/block-library/blocks/group/theme-rtl.css 78亿
构建/块-库/块/组/主题.css 78亿
build/block-library/blocks/heading/style-rtl.css 189亿
build/block-library/blocks/heading/style.css 189亿
build/block-library/blocks/html/editor-rtl.css 336亿
build/block-library/blocks/html/editor.css 337亿
build/block-library/blocks/image/editor-rtl.css 891亿
build/block-library/blocks/image/editor.css 891亿
build/block-library/blocks/image/view.min.js构建/块库/blocks/image/view.min.js 1.54千字节
build/block-library/blocks/latest-comments/style-rtl.css 357亿
构建/块库/blocks/latest comments/style.css 357亿
build/block-library/blocks/media-text/editor-rtl.css 306磅
build/block-library/blocks/media-text/editor.css 305亿
build/block-library/blocks/media-text/style-rtl.css 505亿
build/block-library/blocks/media-text/style.css 503磅
build/block-library/blocks/more/editor-rtl.css 431亿
build/block-library/blocks/more/editor.css 431亿
build/block-library/blocks/navigation-link/editor-rtl.css 668亿
build/block-library/blocks/navigation-link/editor.css 669亿
build/block-library/blocks/navigation-link/style-rtl.css 193亿
build/block-library/blocks/navigation-link/style.css 192亿
build/block-library/blocks/navigation-submenu/editor-rtl.css 296亿
build/block-library/blocks/navigation-submenu/editor.css 295亿
build/block-library/blocks/navigation/editor-rtl.css 2.26千字节
build/block-library/blocks/navigation/editor.css 2.26千字节
build/block-library/blocks/navigation/style-rtl.css 2.26千字节
build/block-library/blocks/navigation/style.css 2.25千字节
build/block-library/blocks/navigation/view.min.js 1.03千字节
build/block-library/blocks/nextpage/editor-rtl.css 395亿
build/block-library/blocks/nextpage/editor.css 395亿
build/block-library/blocks/page-list/editor-rtl.css 377亿
build/block-library/blocks/page-list/editor.css 377亿
build/block-library/blocks/page-list/style-rtl.css 175亿
build/block-library/blocks/page-list/style.css 175亿
build/block-library/blocks/pragment/editor-rtl.css 235亿
build/block-library/blocks/pragment/editor.css 235亿
build/block-library/blocks/post-author/style-rtl.css 175亿
build/block-library/blocks/post-author/style.css 176亿
build/block-library/blocks/post-comments-form/editor-rtl.css 96亿
build/block-library/blocks/post-comments-form/editor.css 96亿
build/block-library/blocks/post-comments-form/style-rtl.css 508亿
build/block-library/blocks/post-comments-form/style.css 508亿
构建/块库/blocks/post-content/editor-rtl.css 74亿
build/block-library/blocks/post-content/editor.css 74亿
build/block-library/blocks/post-date/style-rtl.css 61亿
build/block-library/blocks/post-date/style.css 61亿
build/block-library/blocks/post-extract/editor-rtl.css 71亿
build/block-library/blocks/post-extract/editor.css 71亿
build/block-library/blocks/post-extract/style-rtl.css 141亿
build/block-library/blocks/post-extract/style.css 141亿
build/block-library/blocks/post-featured-image/editor-rtl.css 734亿
build/block-library/blocks/post-featured-image/editor.css 732亿
build/block-library/blocks/post-featured-image/style-rtl.css 342亿
build/block-library/blocks/post-featured-image/style.css 342亿
build/block-library/blocks/post-navigation-link/style-rtl.css 215亿
build/block-library/blocks/post-navigation-link/style.css 214亿
build/block-library/blocks/post-template/editor-rtl.css 99亿
build/block-library/blocks/post-template/editor.css 98亿
build/block-library/blocks/post-template/style-rtl.css 397亿
build/block-library/blocks/post-template/style.css 396亿
build/block-library/blocks/post-terms/style-rtl.css 96亿
构建/块库/blocks/post-terms/style.css 96亿
build/block-library/blocks/post-time-to-read/style-rtl.css 69亿
build/block-library/blocks/post-time-to-read/style.css 69亿
build/block-library/blocks/post-title/style-rtl.css 100亿
build/block-library/blocks/post-title/style.css 100亿
build/block-library/blocks/preactatted/style-rtl.css 125亿
build/block-library/blocks/preactatted/style.css 125亿
build/block-library/blocks/pullquote/editor-rtl.css 135亿
build/block-library/blocks/pullquote/editor.css 135亿
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 122亿
build/block-library/blocks/query-pagination-numbers/editor.css 121亿
build/block-library/blocks/query-pagination/editor-rtl.css 221亿
build/block-library/blocks/query-pagination/editor.css 211亿
build/block-library/blocks/query-pagination/style-rtl.css 288亿
build/block-library/blocks/query-pagination/style.css 284亿
build/block-library/blocks/query-title/style-rtl.css 63亿
build/block-library/blocks/query-title/style.css 63亿
build/block-library/blocks/query/editor-rtl.css 486亿
build/block-library/blocks/query/editor.css 486亿
build/block-library/blocks/query/view.min.js 958亿
build/block-library/blocks/quote/style-rtl.css 237亿
构建/块库/blocks/quote/style.css 237亿
build/block-library/blocks/read-more/style-rtl.css 140亿
build/block-library/blocks/read-more/style.css 140亿
build/block-library/blocks/rss/editor-rtl.css 101亿
build/block-library/blocks/rss/editor.css 101亿
构建/块库/blocks/rss/style-rtl.css 289亿
build/block-library/blocks/rss/style.css 288亿
build/block-library/blocks/search/editor-rtl.css 184亿
build/block-library/blocks/search/editor.css 184亿
build/block-library/blocks/search/style-rtl.css 690亿
build/block-library/blocks/search/style.css 689亿
构建/block-library/blocks/search/theme-rtl.css 114亿
构建/block-library/blocks/search/theme.css 114亿
build/block-library/blocks/search/view.min.js 478亿
build/block-library/blocks/seleparater/theme-rtl.css 194亿
build/block-library/blocks/seleparater/theme.css 194亿
build/block-library/blocks/shortcode/editor-rtl.css 286亿
构建/块库/blocks/shortcode/editor.css 286亿
build/block-library/blocks/site-logo/editor-rtl.css 805亿
build/block-library/blocks/site-logo/editor.css 805亿
build/block-library/blocks/site-tagline/editor-rtl.css 86亿
build/block-library/blocks/site-tagline/editor.css 86亿
build/block-library/blocks/spacer/editor-rtl.css 350亿
build/block-library/blocks/spacer/editor.css 350亿
build/block-library/blocks/spacer/style-rtl.css 48亿
build/block-library/blocks/spacer/style.css 48亿
build/block-library/blocks/table/editor-rtl.css 395亿
build/block-library/blocks/table/editor.css 395亿
build/block-library/blocks/table/style-rtl.css 639亿
build/block-library/blocks/table/style.css 639亿
build/block-library/blocks/template-part/editor-rtl.css 393亿
build/block-library/blocks/template-part/editor.css 393亿
build/block-library/blocks/term-description/style-rtl.css 111亿
build/block-library/blocks/term-description/style.css 111亿
build/block-library/blocks/text-columns/editor-rtl.css 95亿
build/block-library/blocks/text-columns/editor.css 95亿
build/block-library/blocks/text-columns/style-rtl.css 166亿
build/block-library/blocks/text-columns/style.css 166亿
构建/block-library/blocks/verse/style-rtl.css 99亿
build/block-library/blocks/verse/style.css 99亿
build/block-library/blocks/video/editor-rtl.css 552亿
build/block-library/blocks/video/editor.css 555亿
build/block-library/blocks/video/style-rtl.css 185亿
build/block-library/blocks/video/style.css 185亿
build/block-library/classic-rtl.css 179亿
build/block-library/csss 179亿
build/block-library/common-rtl.css 1.11千字节
build/block-library/common.css 1.11千字节
build/block-library/editor-elements-rtl.css 75亿
build/block-library/editor-elements.css 75亿
构建/块-库/元素-rtl.css 54磅
build/block-library/elements.css 54磅
build/block-library/index.min.js 218千字节
build/block-library/reset-rtl.css 472亿
构建/块库/reset.css 472亿
构建/块序列化默认解析器/index.min.js 1.12千字节
build/block-serialization-specifi-parser/index.min.js 2.87千字节
build/blocks/index.min.js 51.8千字节
build/commands/index.min.js 15.2千字节
build/commands/style-rtl.css 953亿
build/commands/style.css 951亿
build/components/index.min.js 222千字节
build/components/style-rtl.css 12千字节
build/components/style.css 12千字节
构建/合成/索引.min.js 12.8千字节
build/core-commands/index.min.js 2.71千巴
构建/core-data/index.min.js 72.5千字节
构建/定制e-widgets/index.min.js 10.9千字节
构建/定制e-widgets/style-rtl.css 1.36千字节
构建/定制e-widgets/style.css 1.36千字节
构建/数据控制/索引.min.js 640亿
build/data/index.min.js 9.01千字节
构建/日期/索引.min.js 17.9千字节
build/deprecated/index.min.js 451亿
构建/dom-ready/index.min.js 324亿
构建/dom/index.min.js 4.65千字节
构建/编辑-发布/分类-rtl.css 578亿
构建/编辑post/classic.css 578亿
build/edit-post/index.min.js 14.7千字节
构建/编辑-发布/样式-rtl.css 2.68千字节
构建/编辑-发布/样式.css 2.68千字节
构建/编辑site/style-rtl.css 12.2千字节
构建/编辑site/style.css 12.2千字节
build/edit-widgets/index.min.js 17.5千字节
build/edit-widgets/style-rtl.css 4.18千字节
build/edit-widgets/style.css 4.18千字节
build/editor/index.min.js 92.6千字节
构建/编辑器/样式-rtl.css 8.61千字节
构建/编辑器/样式.css 8.61千字节
build/element/index.min.js 4.83千字节
build/escape-html/index.min.js 537亿
build/format-library/index.min.js 8.09千字节
build/format-library/style-rtl.css 493亿
构建/格式库/样式.css 492亿
build/hooks/index.min.js 1.55千字节
build/html-entities/index.min.js 448亿
构建/i18n/index.min.js 3.58千字节
构建/交互/调试.min.js 16.4千字节
构建/交互/文件.min.js 447亿
构建/交互/image.min.js 1.67千字节
构建/交互性/index.min.js 13.2千字节
构建/交互/导航.min.js 1.17千字节
build/interactivity/query.min.js 740亿
构建/交互/路由.min.js 2.81千字节
构建/交互/搜索.min.js 618磅
构建/is-shallow-equal/index.min.js 527亿
构建/键盘快捷方式/index.min.js 1.31千字节
build/keycodes/index.min.js版本 1.46千字节
构建/list-reasable-blocks/index.min.js 2.14千字节
构建/list-rusable-blocks/style-rtl.css 851亿
build/list-rusable-blocks/style.css 851亿
build/media-utils/index.min.js 2.92千字节
build/modules/importmap-polyfill.min.js 12.2千字节
build/notices/index.min.js 948亿
build/nux/index.min.js 1.58千字节
build/nux/style-rtl.css 748亿
build/nux/style.css 744亿
build/patterns/index.min.js 6.51千巴
build/patterns/style-rtl.css 595亿
构建/模式/样式.css 595亿
build/plugins/index.min.js 1.81千字节
build/preferences-persistence/index.min.js 2.06千字节
build/preferences/index.min.js 2.9千字节
build/preferences/style-rtl.css 719亿
build/preferences/style.css 721亿
build/primitives/index.min.js 831亿
build/priority-queue/index.min.js 1.52千字节
build/private-apis/index.min.js 1千字节
build/react-i18n/index.min.js 629亿
build/react-refresh-entry/index.min.js 9.47千字节
build/react-refresh-runtime/index.min.js 6.78千字节
build/redux-routine/index.min.js 2.7千字节
构建/可重用块/index.min.js 2.72千字节
构建/可重用块/样式-rtl.css 256亿
构建/可重用块/样式.css 256亿
构建/rich-text/index.min.js 10.1千字节
build/router/index.min.js版本 1.96千字节
build/server-side-render/index.min.js 1.97千字节
build/shortcode/index.min.js 1.39千字节
build/style-engine/index.min.js 2.02千巴
构建/token-list/index.min.js 582亿
构建/url/index.min.js 3.74千巴
build/vendors/react-dom.min.js 42.8千字节
build/vendors/react-jsx-runtime.min.js 554亿
build/vendors/react.min.js 2.65千字节
build/viewport/index.min.js 964亿
build/warning/index.min.js 249亿
build/widgets/index.min.js 7.13千字节
构建/widgets/style-rtl.css 1.17千字节
构建/widgets/style.css 1.17千字节
构建/wordcount/index.min.js 1.02千字节

压缩尺寸作用

@埃拉特里克斯
复制链接
成员 作者

我们不想撤销任何特定性的降低,我们只想将其置于与重置样式相同或更高的级别。我们不想恢复全局样式特异性降低。

我没有足够的背景知识来解释为什么需要进行这一改变,因此,如果能对这篇公关文章进行更全面的描述,或者链接到某个问题,我将不胜感激!

我不知道我能吃多饱,但我会试试。当在元素指定级别上有重置样式时,它们将否决任何零特异性全局样式?

@埃拉特里克斯 埃拉特里克斯补充这个[类型]Bug 现有功能无法按预期工作标签2024年5月14日
@阿隆·罗伯特肖
复制链接
贡献者

我对提案的理解是:

  • 所有生成的样式仍然需要具有相同的特性
  • 的复本#60106将导致不同的选择器特性(请参见按钮块)
  • 此PR只会在一定程度上影响统一的特殊性,从而防止重置样式覆盖块样式

因此,如果这是正确的,我认为不需要还原,但可能需要对核心块的块库样式进行一些额外的调整。

不幸的是,这仍然提供了特异性的普遍降低,而不是像我们在一个从头开始的理想世界中那样降至零。

复制链接

github-操作 机器人程序 评论2024年5月14日

在中检测到片状测试f1b413f型.
一些测试通过,但尝试失败。失败可能与此提交无关,但仍会报告以供查看。请参见文档了解更多信息。

🔍 工作流运行URL:https://github.com/WordPress/gutenberg/actions/runs/9221646544
📝 报告的问题:

复制链接

github-操作 机器人程序 评论2024年5月14日

以下账户与本公关和/或相关问题进行了互动。当活动发生时,我将继续更新这些列表。您还可以通过添加支柱支架标签。

如果您通过GitHub上的拉请求合并代码,请将以下内容复制并粘贴到合并提交消息的底部。

合著者:ellatrix<ellatrix@git.wordpress.org>合著者:亚伦·罗伯特·肖<aaronrobertshaw@git.wordpress.org>合著者:告诉机器<isabel_brison@git.wordpress.org>合著者:塔尔丹<talldanwp@git.wordpress.org>合著者:andrewserong<andrewserong@git.wordpress.org>

为了理解WordPress项目对贡献者的期望,请查看核心手册中的贡献者归因页面.

@@ -1,9 +1,7 @@
//与组块样式相同。
:其中(.wp块模板部分){
&.has背景{
复制链接
成员 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

看来我们之前确实有一些特殊性。我们应该确保它现在测试良好。

//将“图”添加到选择器中可以增加全局
//风格特异性,其水平为0-1-0。我们应该找出原因
//需要“figure”。
:root:其中(图.wp-block-gallery){
复制链接
成员 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

我刚加了一句:根作为预防措施,请确保这会覆盖任何重置样式。

@阿隆·罗伯特肖
复制链接
贡献者

我对这个进行了重新设置,以解决以下方面的CSS linting错误秩序.

关于使用的选择:根结束html格式身体,这也提供了绝大多数块的优点,无需降低其一般块样式的特异性。也就是说,如果它们不指定自定义选择器并依赖于默认块类(.wp-块-*),样式目标可以保持不变。

@阿隆·罗伯特肖
复制链接
贡献者

阿隆·罗伯特肖 评论2024年5月17日

恢复0-1-0边缘样式的特异性主题.scss文件意味着它们将覆盖一些也被减少为零的布局支持样式,例如。:其中(.is-layout-constrained)>*

抄送/@告诉机器@安德鲁斯隆了解您可能还需要更新哪些其他布局样式的专业知识

此外,我有以下关于降低特异性的近期PR列表。还有我错过的吗?

@阿隆·罗伯特肖
复制链接
贡献者

我推动了一项承诺,我认为这可能是使布局样式工作并保持一些更一致的特定性所需的最小更改集。

老实说,我花了很长时间才弄清楚布局样式选择器应该更新什么,不应该更新什么。特别是,当遇到同样出现在主干上的错误时(#61849,#61846等等)

展望未来,我认为我们肯定需要一些测试覆盖率,以确保正确的布局样式在何时何地应用。这些也可以作为需要更改布局支持某些方面的任何人的内部文档。

值得注意的是,本次公关讨论的是我们应该确定WP 6.6的CSS特性.

@阿隆·罗伯特肖
复制链接
贡献者

经过一段时间讨论,并考虑到6.6 beta之前的有限时间,可以选择使用:根前缀似乎是最安全的选择,似乎得到了大多数人的支持。

该PR应做好完善、审查等准备,以便尽快登陆。

@@ -2,6 +2,6 @@
@包括标题样式主题();
}

:其中(.wp-块嵌入){
.wp-块嵌入{
复制链接
贡献者

@塔尔丹 塔尔丹 2024年5月23日

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

如果.wp-块嵌入图形标题此文件顶部的规则降低了特定性?

而不是添加:根每个单独的规则或删除:其中,我认为这样做可能更好:

:根{:哪里(.wp-块嵌入) {//...}}

这样一切都是一致的。

我意识到它与一个类名具有相同的特殊性,但它使任何修改css的人都可以更容易地保持相同的特异性。

将来如果我们需要实现层,我们可以替换:根具有@图层名称,或者如果我们想将特异性降低到零,则删除:根{}包装器。

复制链接
贡献者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

该文件顶部的.wp-block-embed图形标题规则是否降低了特定性?

我会这么说。一个粗略的规则可能是“任何可以通过全局样式配置的内容都应该是”。

mixin的一瞥颜色字体大小规则和标题现在是Global Styles中的一个可配置元素。

与其在每个单独的规则中添加:root或删除:where,不如这样做:

听起来不错。我仍在努力应对这场公关活动的影响#61032而且还没有完成所有的积木风格。

我的理解是,该PR只调整了原始零特异性PR中的更改,而事实证明该更改有点不完整。有人讨论说,一旦一切都解决了,我们需要对所有块样式进行全面审核。

复制链接
贡献者

@阿隆·罗伯特肖 阿隆·罗伯特肖 2024年5月23日

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

建议的嵌套方法可能存在的一个问题:根:其中就像这样,它可能会鼓励人们认为他们仍然可以将下一个选择器嵌套在:其中当他们真的必须定义整个选择器或使嵌套的选择器链成为另一个选择器时:其中()例如

:根{:哪里(.wp块按钮) {//...&:哪里(> .wp-块-按钮__link) {//...}}:其中(.wp块按钮>.wp-块-按钮__link) {//...}}

复制链接
贡献者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

是的,它得到了一点不是吗。😬

复制链接
贡献者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

:root{
:其中(.wp-block-embed){
// ...
}
}

我看过这个建议,但它与一些更复杂的选择器一起变得复杂起来,所以现在最好保持简单。

@阿隆·罗伯特肖
复制链接
贡献者

我已经更新了中的按钮块样式5a6f6。值得注意的是,与后备边框显示相关的样式已被删除。

#61556登陆后,我们可以在编辑器设置中访问合并的全局样式数据。计划后续更新编辑器中的边界面板,以利用此数据,并仅在需要时应用回退。

另一种方法是将后备边框样式移动到库/theme.json按钮块的自定义css被证明不成功。这些样式需要位于核心的theme.json样式和主题或用户的任何样式之间。通过UI解决边界UX是一个更好的解决方案,也意味着我们可以为具有这些后备样式的每个块提供更少的CSS。

@阿隆·罗伯特肖
复制链接
贡献者

似乎Separator块的全局样式无法与主题一起使用,这些主题在theme.json(包括TT4)中为块定义了不止一种背景色。这是主干上目前的行为,所以我不能100%确定是否有回归,或者出于某种原因是这样的。改进这一点可以添加到后续行动列表中。

为了进行此PR,在中更新了分隔块的样式2英尺70英尺/天,只需注意测试时的奇怪行为。

@阿隆·罗伯特肖
复制链接
贡献者

我对社交链接、表格和标记云块做了进一步的调整。这些块样式变化样式更新需要另一个良好的测试,但这必须等到明天。

@阿隆·罗伯特肖 阿隆·罗伯特肖删除了 try/prefix样式-带-rot 分支 2024年5月28日05:20
@github-操作 github-操作 机器人程序将此添加到古腾堡18.5里程碑2024年5月28日
@告诉机器
复制链接
贡献者

(姗姗来迟)对此进行了测试,一切似乎都如期进行!

草稿回传请购单可在WordPress/WordPress-develop#6633。对于旧的零特定性更改,最容易关闭当前挂起的回传端口(WordPress/WordPress开发#6522)然后继续当前草稿。

这听起来很明智,我继续并关闭了我的个人记录。

@阿隆·罗伯特肖
复制链接
贡献者

Backport已准备好在中进行审查WordPress/WordPress-develop#6633

@阿隆·罗伯特肖 阿隆·罗伯特肖补充这个需要开发说明 需要一份主要WordPress发布周期的开发人员说明标签2024年5月29日
卡斯廷轴子推送提交致carstingaxion/gutenberg引用的这个拉请求 2024年6月4日
…61638)合著者:ellatrix<ellatrix@git.wordpress.org>合著者:亚伦·罗伯特·肖<aaronrobertshaw@git.wordpress.org>合著者:告诉机器<isabel_brison@git.wordpress.org>合著者:塔尔丹<talldanwp@git.wordpress.org>合著者:andrewserong<andrewserong@git.wordpress.org>合著人:kevin940726<kevin940726@git.wordpress.org>
@阿隆·罗伯特肖
复制链接
贡献者

阿隆·罗伯特肖 评论2024年6月6日

开发说明:WordPress 6.6 CSS特定性

WordPress 6.6的目标之一是简化主题作者覆盖核心样式的过程,同时保持对Global styles的支持。

从历史上看,核心样式中的高度CSS专用性使得定制具有挑战性和不可预测性,通常需要复杂的CSS规则才能实现预期的结果。新产品的开发横断面样式该功能还强调了对统一CSS特性的需要,以支持嵌套此类样式,从而促进复杂分层设计的创建。

均匀0-1-0特异性

WordPress 6.6引入了一些更改,旨在广泛降低CSS的特殊性并使其更加统一。这些变化通常分为两类:

  1. 核心块样式
  2. 主题.json/全球风格:

如果需要对CSS特性进行调整,可以通过将现有选择器包装在:root:其中(…).

核心块样式

选择0-1-0特殊性大大减少了现有核心块样式所需的更改,因为块针对其默认样式.wp-块-<名称>类已经具有所需的特定性。

任何支持Global Styles并使用更高特异性选择器的块都将这些选择器封装在:root:其中(…)这也适用于块样式(也称为块样式变体)及其默认样式,例如。.wp-block-image.is-style-rounded img已更新为:root:where(.wp-block-image.is-style-rounded img).

主题.json/全球风格:

所有块样式,包括由Theme.json和Global styles输出的块样式变体样式,现在都限制为0-1-0特异性。布局样式,如约束、灵活、流动等也受到了限制,但取决于具体的布局类型和定义,最终的具体程度与0-1-0所以它们可以正确应用。

用法

对齐0-1-0全局样式对默认块选择器的特殊性,例如。.wp-块-<名称>,大大减少了更新的需要。如果主题和块作者依赖使用更复杂选择器的自定义CSS,建议他们仔细检查自己的设计。

自定义块

自定义块的作者可以选择全局样式并通过大于的选择器应用默认样式0-1-0特异性,应该更新那些包装它们的选择器:root:where().

一个例子可以是一个自定义列表块,它选择填充块支持,但通过以下方式定义默认填充:

ul公司.wp-block客户列表{衬垫: 0;}

如果不调整此规则的特定性,则会覆盖全局样式中块类型填充的任何自定义。封装选择器:root:where()这里允许样式加载顺序确定哪个规则优先。

//块的样式表: :哪里(ul.wp-block-custom-list){//这是一个虚构的示例,可能只是“.wp-block-custom-list”`衬垫: 0;}//全局样式-在块样式之后加载: :哪里(.wp-block客户列表) {衬垫: 1相对长度单位;}

块样式(也称为块样式变体)

主题作者自定义块样式对于核心块,需要限制其样式的特殊性,以便块样式可以继续通过全局样式进行配置。

例如,以调整图像块的“圆角”块样式的边界半径的主题为例:

.wp-块-图像.是基于样式的 国际货币基金组织{边界半径: 2相对长度单位;}

如果不进行调整,此样式将覆盖对全局样式中的圆角块样式所做的任何自定义。

在这种情况下,主题可以将其圆形图像样式调整为以下样式:

//. 主题样式: :哪里(.wp-块-图像.是基于样式的 国际货币基金组织) {边界半径: 2相对长度单位;}//全局样式-在块样式之后加载: :哪里(.wp-块-图像.是基于样式的 国际货币基金组织) {边界半径: 4二甲苯;}

零特定性、CSS层和未来

在确定0-1-0特异性。不幸的是,面对常见的重置样式表,零特异性并不可靠,需要进行更广泛的更改。

CSS层也进行了评估,但由于无法强制执行属于一个层的所有样式,因此没有达到要求。这一点在未来将有所改变,届时可以重新考虑CSS层和零特异性的组合,以进一步从CSS特异性的初始降低中获得好处。

更多历史和背景可以在这里找到详细讨论.

有用的链接

@阿隆·罗伯特肖 阿隆·罗伯特肖补充有开发说明 当开发注释完成时(对于即将发布的WordPress版本)和已删除需要开发说明 需要一份主要WordPress发布周期的开发人员说明标签2024年6月6日
贾斯坦塔德洛克添加了提交至x3p0-dev/x3p0-1deas引用的这个拉请求 2024年6月9日
在Core/Gutenberg中添加“:root”特性似乎覆盖了这一点。请参见:WordPress/gutenberg#61638
@阿隆·罗伯特肖 阿隆·罗伯特肖补充后端口至WP核心 已成功合并到WP Core的Pull请求和已删除需要PHP回传 需要将PHP回传到核心标签2024年6月12日
柏油vipul推送提交帕蒂尔·维普尔/古腾堡引用的这个拉请求 2024年6月17日
…61638)合著者:ellatrix<ellatrix@git.wordpress.org>合著者:亚伦·罗伯特·肖<aaronrobertshaw@git.wordpress.org>合著者:告诉机器<isabel_brison@git.wordpress.org>合著者:塔尔丹<talldanwp@git.wordpress.org>合著者:andrewserong<andrewserong@git.wordpress.org>合著人:kevin940726<kevin940726@git.wordpress.org>
@贾斯坦塔德洛克
复制链接
贡献者

大多数主题和自定义块不需要任何更新。

我会在Dev Note中非常小心地说这句话。到目前为止,我已经看到不少来自构建主题的人的报告,这些更改以各种方式改变了他们的设计。我想说每个主题和区块作者都应该检查他们的设计。不一定非得这样天哪,天要塌下来了,但它应该积极主动地告诉他们,事实是,这可以而且将影响定制CSS发挥作用的设计。

@阿隆·罗伯特肖
复制链接
贡献者

感谢您的反馈@贾斯坦塔德洛克,很感激👍

虽然对目录进行了多次深入研究,发现大多数主题和插件都不需要更新,但这并不意味着需要调整的数量微不足道。我无意提出其他建议或制造虚假的安全感,所以我用以下内容更新了这句话。

将全局样式的0-1-0特性与默认块选择器对齐,例如。.wp-块-<名称>,大大减少了更新的需要。如果主题和块作者依赖使用更复杂选择器的自定义CSS,建议他们仔细检查自己的设计。

我希望能达到更好的平衡🤞

免费注册 在GitHub上加入此对话.已经有帐户了吗?登录以发表评论
标签
后端口至WP核心 已成功合并到WP Core的Pull请求 CSS样式 与编辑器和前端样式、CSS特定问题相关。 全球风格 与更广泛的Global Styles工作相关的任何内容,包括Styles Engine和theme.json 有开发说明 当开发注释完成时(对于即将发布的WordPress版本) [类型]Bug 现有功能无法按预期工作
项目
没有打开的项目
状态:多恩
开发

成功合并此请求可能会解决这些问题。

6名参与者