跳到内容
新问题

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

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

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

允许边距控件为负值 #60347

已合并
将16个提交合并到
2024年4月22日
已合并

允许边距控件为负值 #60347

将16个提交合并到
2024年4月22日

对话

MaggieCabrera公司
复制链接
贡献者

@MaggieCabrera公司 MaggieCabrera公司 评论2024年4月1日

什么?

替代#40464
关闭 #32644

为什么?

将theme.json中的奇偶校验带到控件。主题可以通过theme.json定义负边距,但不能通过模板定义,因为模板是最有用的。

怎么用?

看看前面的对话,我们需要考虑一些事情来实现这一点:

  1. 块相互重叠时,在编辑器中选择块。用户体验可能会有点复杂。
  2. 之前的尝试是添加一个新的道具,我们不再需要它了,所以我们没有添加新的API来实现这一点,我们只是更改输入只接受边距控制的最小值
  3. 我们需要更新区块支持的可视化工具来显示负利润。@贾斯穆森建议使用灰色而不是蓝色。这可能会在后续行动中发生。

在所有这些中,1是最令人担忧的。这个PR背后的想法是,如果用户有意识地选择在边距值之前加一个减号,我们只允许负值。此PR将z索引值添加到当前选定的块中,以使其保持在前面,从而有助于完成此操作。

要执行的操作:

这些可以在单独的PR上完成

要考虑:

  • 我们是否应该限制负边距可以达到的值,以防止块导航问题?我很犹豫,但有人建议.

测试说明

检查是否可以在支持它们的任何块上添加负边距,例如:组、段落、列、代码、封面、分隔符、分隔符。。。

检查前端和编辑器是否显示相同的内容

在编辑器中检查,当您选择一个块时,即使它被另一个块重叠,它也会将其置于最前面。这不应该发生在前端。

如果主题没有间距大小声明(无间距预设),则上述操作应以相同方式进行。

键盘测试说明

屏幕截图或屏幕广播

@MaggieCabrera公司 MaggieCabrera公司补充[类型]增强功能 改进建议。 全局样式 与更广泛的Global Styles工作相关的任何内容,包括Styles Engine和theme.json标签2024年4月1日
复制链接

github-操作 机器人程序 评论2024年4月1日

尺寸变化:+456亿(0%)

总大小:1.75 MB

文件名 大小 更改
build/block-editor/content-rtl.css 4.53千字节 +26亿(+1%)
构建/块编辑器/内容.css 4.53千字节 +25亿(+1%)
build/block-editor/index.min.js 256千字节 +134 B(0%)
build/block-library/blocks/group/style-rtl.css 103亿 +46亿(+81%) 🆘
build/block-library/blocks/group/style.css 103亿 +46亿(+81%) 🆘
build/block-library/style-rtl.css 14.8千字节 +21亿(0%)
build/block-library/style.css 14.8千字节 +21亿(0%)
build/components/index.min.js 220千字节 +137亿(0%)
ℹ️查看未更改
文件名 大小
构建/a11y/index.min.js 955亿
build/annotations/index.min.js 2.27千字节
build/api获取/index.min.js 2.32千字节
构建/auto/index.min.js 2.1千字节
build/blob/index.min.js 578亿
build/block-directory/index.min.js 7.26千字节
构建/块目录/样式-rtl.css 1.03千字节
构建/块目录/样式.css 1.03千字节
构建/块编辑器/默认编辑器样式-rtl.css 395亿
构建/块编辑器/默认编辑器样式.css 395亿
build/block-editor/style-rtl.css 15.7千字节
构建/块编辑器/样式.css 15.7千字节
build/block-library/blocks/archives/editor-rtl.css 61亿
构建/块库/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亿
构建/block-library/blocks/audio/theme-rtl.css 133亿
构建/block-library/blocks/audio/theme.css 133亿
build/block-library/blocks/avatar/editor-rtl.css 116亿
构建/块库/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 305亿
build/block-library/blocks/block/editor.css 305亿
build/block-library/blocks/button/editor-rtl.css 415亿
build/block-library/blocks/button/editor.css 414亿
build/block-library/blocks/button/style-rtl.css 627亿
build/block-library/blocks/button/style.css 626亿
build/block-library/blocks/buttons/editor-rtl.css 337亿
构建/块库/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亿
构建/块库/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亿
build/block-library/blocks/columns/style.css 421亿
build/block-library/blocks/comment-author-avatar/editor-rtl.css 125亿
build/block-library/blocks/comment-author-avatar/editor.css 125亿
构建/块库/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亿
构建/块库/blocks/comments分页/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亿
build/block-library/blocks/cover/editor-rtl.css 671亿
build/block-library/blocks/cover/editor.css 674亿
build/block-library/blocks/cover/style-rtl.css 1.7千字节
build/block-library/blocks/cover/style.css 1.69千字节
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亿
build/block-library/blocks/details/style.css 86亿
build/block-library/blocks/embed/editor-rtl.css 322亿
build/block-library/blocks/embed/editor.css 322亿
build/block-library/blocks/embed/style-rtl.css 410亿
build/block-library/blocks/embed/style.css 410亿
build/block-library/blocks/embed/theme-rtl.css 133亿
build/block-library/blocks/embed/theme.css 133亿
build/block-library/blocks/file/editor-rtl.css 326亿
构建/块库/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亿
构建/块库/块/表单提交按钮/style.css 69亿
build/block-library/blocks/form/view.min.js 471亿
build/block-library/blocks/freeform/editor-rtl.css 2.61千字节
构建/块库/块/自由形式/编辑器.css 2.61千字节
build/block-library/blocks/galletry/editor-rtl.css 956亿
build/block-library/blocks/galletry/editor.css 960亿
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 647亿
build/block-library/blocks/group/editor.css 647亿
构建/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 878亿
构建/块库/blocks/images/editor.css 878亿
build/block-library/blocks/image/style-rtl.css 1.6千字节
build/block-library/blocks/image/style.css 1.59千字节
构建/block-library/blocks/image/theme-rtl.css 133亿
构建/block-library/blocks/image/theme.css 133亿
build/block-library/blocks/image/view.min.js 1.54千字节
构建/block-library/blocks/latest comments/style-rtl.css 357亿
build/block-library/blocks/latest-comments/style.css 357亿
build/block-library/blocks/platest-posts/editor-rtl.css 213亿
build/block-library/blocks/platest-posts/editor.css 212亿
build/block-library/blocks/platest-posts/style-rtl.css 478亿
build/block-library/blocks/platest-posts/style.css 478亿
build/block-library/blocks/list/style-rtl.css 88亿
build/block-library/blocks/list/style.css 88亿
build/block-library/blocks/media-text/editor-rtl.css 306亿
build/block-library/blocks/media-text/editor.css 305亿
构建/块库/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 259亿
build/block-library/blocks/navigation-link/style.css 257亿
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千字节
构建/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/pragment/style-rtl.css 335亿
build/block-library/blocks/pragment/style.css 335亿
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亿
构建/块库/块/发布评论表单/editor.css 96亿
build/block-library/blocks/post-comments-form/style-rtl.css 508磅
build/block-library/blocks/post-comments-form/style.css 508磅
build/block-library/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 729亿
build/block-library/blocks/post-featured-image/editor.css 727亿
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 409亿
构建/块库/blocks/post-template/style.css 408亿
build/block-library/blocks/post-terms/style-rtl.css 96亿
build/block-library/blocks/post-terms/style.css 96亿
构建/块库/块/读取后时间/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/pullquote/style-rtl.css 354亿
build/block-library/blocks/pullquote/style.css 353亿
build/block-library/blocks/pullquote/theme-rtl.css 174亿
构建/block-library/blocks/pullquote/theme.css 174亿
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亿
build/block-library/blocks/quote/style.css 237亿
构建/block-library/blocks/quote/theme-rtl.css 233亿
构建/block-library/blocks/quote/theme.css 235亿
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 149亿
build/block-library/blocks/rss/editor.css 149亿
build/block-library/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亿
构建/块库/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/seleparator/editor-rtl.css 146亿
build/block-library/blocks/seleparator/editor.css 146亿
build/block-library/blocks/seleparater/style-rtl.css 239亿
build/block-library/blocks/seleparater/style.css 239亿
build/block-library/blocks/seleparater/theme-rtl.css 194亿
build/block-library/blocks/seleparater/theme.css 194亿
构建/块库/blocks/shortcode/editor-rtl.css 323亿
build/block-library/blocks/shortcode/editor.css 323亿
build/block-library/blocks/site-logo/editor-rtl.css 801亿
build/block-library/blocks/site-logo/editor.css 801亿
build/block-library/blocks/site-logo/style-rtl.css 204磅
build/block-library/blocks/site-logo/style.css 204磅
build/block-library/blocks/site-tagline/editor-rtl.css 86亿
build/block-library/blocks/site-tagline/editor.css 86亿
build/block-library/blocks/site-title/editor-rtl.css 116亿
build/block-library/blocks/site-title/editor.css 116亿
build/block-library/blocks/site-title/style-rtl.css 57亿
build/block-library/blocks/site-title/style.css 57亿
build/block-library/blocks/social-link/editor-rtl.css 184亿
构建/块库/块/社交链接/editor.css 184亿
build/block-library/blocks/social-links/editor-rtl.css 676亿
build/block-library/blocks/social-links/editor.css 675亿
build/block-library/blocks/social-links/style-rtl.css 1.48千巴
build/block-library/blocks/social-links/style.css 1.48千巴
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亿
构建/块库/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/table/theme-rtl.css 152亿
build/block-library/blocks/table/theme.css 152亿
build/block-library/blocks/tag-cloud/style-rtl.css 251亿
构建/块库/块/标记云/style.css 253亿
build/block-library/blocks/template-part/editor-rtl.css 431亿
build/block-library/blocks/template-part/editor.css 431亿
build/block-library/blocks/template-part/theme-rtl.css 107亿
build/block-library/blocks/template-part/theme.css 107亿
build/block-library/blocks/term-description/style-rtl.css 111亿
build/block-library/blocks/term-description/style.css 111亿
构建/块库/blocks/text列/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亿
build/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亿
构建/block-library/blocks/video/theme-rtl.css 133亿
build/block-library/blocks/video/theme.css 133亿
build/block-library/classic-rtl.css 179亿
构建/块库/classic.css 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亿
构建/块库/editor-rtl.css 12.4千字节
build/block-library/editor.css 12.4千字节
构建/块-库/元素-rtl.css 54亿
build/block-library/elements.css 54亿
build/block-library/index.min.js 219千字节
build/block-library/reset-rtl.css 472亿
构建/块库/reset.css 472亿
构建/块库/theme-rtl.css 707亿
构建/块-库/theme.css 713亿
build/block-serialization-default-parser/index.min.js 1.12千字节
build/block-serialization-specifi-parser/index.min.js 2.87千字节
build/blocks/index.min.js 51.6千字节
build/commands/index.min.js 15.2千字节
build/commands/style-rtl.css 953亿
build/commands/style.css 951亿
build/components/style-rtl.css 11.9千字节
build/components/style.css 11.9千字节
构建/撰写/索引min.js 12.6千字节
build/core-commands/index.min.js 2.77千字节
构建/core-data/index.min.js 72.5千字节
构建/定制e-widgets/index.min.js 11千字节
构建/定制e-widgets/style-rtl.css 1.36千字节
构建/定制e-widgets/style.css 1.36千字节
构建/数据控制/索引.min.js 640亿
build/data/index.min.js 9千字节
构建/日期/索引.min.js 17.9千字节
build/deprecated/index.min.js 451亿
build/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 17.9千字节
构建/编辑-发布/样式-rtl.css 4.24千字节
构建/编辑-发布/样式.css 4.23千字节
build/edit-site/index.min.js 225千字节
构建/编辑site/style-rtl.css 13.9千字节
构建/编辑site/style.css 13.9千字节
build/edit-widgets/index.min.js 17.6千字节
build/edit-widgets/style-rtl.css 4.16千字节
build/edit-widgets/style.css 4.16千字节
build/editor/index.min.js 77.9千字节
构建/编辑器/样式-rtl.css 6.95千字节
构建/编辑器/样式.css 6.95千字节
build/element/index.min.js 4.83千字节
build/escape-html/index.min.js 537亿
build/format-library/index.min.js 8.07千字节
build/format-library/style-rtl.css 493亿
构建/格式库/样式.css 492亿
build/hooks/index.min.js 1.55千字节
build/html-entities/index.min.js 448亿
build/i18n/index.min.js版本 3.58千字节
构建/交互/调试.min.js 16.2千字节
构建/交互/文件.min.js 447亿
构建/交互/image.min.js 1.67千字节
构建/交互性/index.min.js 13千字节
构建/交互/导航.min.js 1.17千字节
build/interactivity/query.min.js 740亿
构建/交互/路由.min.js 2.79千字节
构建/交互/搜索.min.js 618亿
构建/is-shallow-equal/index.min.js 527亿
构建/键盘快捷方式/index.min.js 1.3千字节
build/keycodes/index.min.js 1.46千字节
构建/list-reasable-blocks/index.min.js 2.11千字节
构建/list-rusable-blocks/style-rtl.css 851亿
构建/列出可重用块/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.57千字节
build/nux/style-rtl.css 748亿
build/nux/style.css 744亿
build/patterns/index.min.js 6.47千字节
build/patterns/style-rtl.css 595亿
构建/模式/样式.css 595亿
build/plugins/index.min.js 1.8千字节
build/preferences-persistence/index.min.js 2.06千字节
build/preferences/index.min.js 2.85千字节
build/preferences/style-rtl.css 710磅
build/preferences/style.css 712亿
build/primitives/index.min.js 975亿
build/priority-queue/index.min.js 1.52千字节
构建/私有apis/index.min.js 1千字节
build/react-i18n/index.min.js 623亿
build/react-refresh-entry/index.min.js 9.47千字节
build/reflect刷新运行时/index.min.js 6.78千字节
build/redux-routine/index.min.js 2.7千字节
构建/可重用块/index.min.js 2.73千字节
构建/可重用块/样式-rtl.css 256亿
构建/可重用块/样式.css 256亿
构建/rich-text/index.min.js 10千字节
build/router/index.min.js 1.88千字节
构建/服务器端渲染/index.min.js 1.96千字节
build/shortcode/index.min.js 1.39千字节
build/style-engine/index.min.js 2.03千字节
构建/token-list/index.min.js 582亿
构建/url/index.min.js 3.74千字节
build/vendors/intert-polyfill.min.js 2.48千字节
build/vendors/react-dom.min.js 41.7千字节
build/vendors/react.min.js 4.02千字节
build/viewport/index.min.js 957亿
build/warning/index.min.js 249亿
build/widgets/index.min.js版本 7.23千字节
构建/widgets/style-rtl.css 1.17千字节
build/widgets/style.css 1.17千字节
构建/wordcount/index.min.js 1.02千字节

压缩尺寸作用

@巴德纳
复制链接

我来这里是为了这个。希望它合并!

@MaggieCabrera公司
复制链接
贡献者 作者

@贾斯穆森我一直在探索这个问题,似乎我们需要在前端设置相对位置,以便重叠工作。编辑器有它,所以它可以工作,但前端没有。它应该只在出现负边距时应用吗?

编辑器

屏幕截图2024-04-02,09 53 27

前端

屏幕截图2024-04-02,09 53 20

@贾斯穆森
复制链接
贡献者

做得很好。我看到了问题,当没有应用相对职位时,只有团队的背景重叠:
混合在一起

gif显示正在应用的边距,以及编辑器和前端之间的差异

相对于应用位置二者都或对应用了负边距的对象,使视觉匹配预期:

前端匹配编辑器

试验内容
<!-- wp:group{“style”:{“spacing”:{“padding”:}“top”:“var:preset|spacing|10”,“bottom”:“val:preset| spacing/10”,“left”:“var:preset|10”}},“backgroundColor”:“accent-4”,“layout”:{type:“constrained”}}--><div class=“wp-block-group has-accent-4-background-color has-background”style=“padding-top:var(--wp-preset--spacing-10);padding-right:varwp:段落--><p>第1组</p><!-- /wp:段落--></div><!-- /wp:组--><!-- wp:group{“style”:{“spacing”:{“padding”:}“top”:“var:preset|spacing|10”,“bottom”:“val:preset| spacing/10”,“left”:“var:preset|10”},“margin”:<div class=“wp-block-group has-accent-background-color has-background”style=“margin-top:-30px;padding-top:var(--wp-preset--spacing--10);padding right:varwp:段落--><p>第2组</p><!-- /wp:段落--></div><!-- /wp:组-->

这里似乎有三条路:

  1. 允许差异。
  2. 应用位置:相对;全盘传到每个街区。
  3. 应用位置:相对;一旦你也申请了负利润。

1并不理想。如果你试图构建一个没有自定义CSS的纯块主题,那么前端与编辑器匹配是很重要的。

2实际上会使前端更接近编辑器的实际状态。在编辑器中,位置:相对;应用于每个块,以便正确定位块UI,因此有理由认为,更广泛地应用它是为了解决这种差异。然而,这是一个更大的变化,所以也许应该在单独的上下文中进行明智的讨论。

看起来这可能是一个goldilocks解决方案,可以阻止该功能的落地。当你应用负边际时,它会与上下文相关,在我的快速测试中,负边际可以解决手头的问题。需要注意的是,要么以非常低的特异性(即。:其中),这样,如果您显式地将Group块的位置指定为粘性,则这不会与之冲突。这似乎是一个棘手的问题。

另一种选择是只应用位置:相对;默认为每块,以解决那里的堆叠问题,但允许目前每个街区的差异?

房间里的大象是:只有在theme.json中,负边距已经是可能的了,所以这些堆叠问题已经成为可能。

@MaggieCabrera公司
复制链接
贡献者 作者

@贾斯穆森我们如何瞄准利润率为负的区块?添加类?这似乎不是我们想要保持的。也许像布局一样吧?其他哪些区块可能受到影响?

我也用一个columns块检查了这一点,因为columns模块应用了display flex,所以问题没有发生。

如果我们将测试块包装在一个堆栈或一行中,问题就会消失,因为:

<!-- wp:group{“layout”:{“type”:“flex”,“orientation”:“vertical”}}--><div class=“wp-block-group”><!--wp:group{“style”:{“spacing”:{“padding”:}“top”:“var:preset|spacing|30”,“bottom”:“val:preset| spacing|10”,“left”:“var:preset@spacing/50”}},“backgroundColor”:“contrast-2”,“layout”:{type:“constrained”}}--><div class=“wp-block-group has-contrast-2-background-color has-background”style=“padding-top:var(--wp-preset--spacing-30);padding-right:var”(--wp--preset--space--50);pading-bottom:varwp:段落--><p>第1组</p><!-- /wp:段落--><!-- wp:分隔符--><hr class=“wp-block-separtator has-alpha-channel-opacity”/><!-- /wp:分隔符--><!-- wp:段落--><p>Lorem ipsum悲哀坐在amet,奉献敬爱的精英。Sed sagittis libero posuere enim pellentesque,一个convallis mauris unmediate。埃涅阿斯在选帝侯(lectus eu tortor luctus convallis)。非舌间层最大Aliquam maximus。埃涅阿斯奉献给了梅特斯。Etiam sodales nec eros无效。Nullam libero urna,auctor vel ultrices sit amet,tincidunt vel lacus。Morbi ut ante risus。Morbi vulputate ante vel elit ultrices semper公司。最终莫尔比隐匿性疾病在各种疾病中传播。Interdum et malesuada在福克斯(faucibus)著名的“前伊普森·普里米斯”(ante ipsum primis)。Sed lectus arcu,ultrices vitae feugiat et,dapibus sit amet elit等。在ipsum ultrices porttitor euismod nec justo的nisi中的Nulla</p>(第页)<!-- /wp:段落--></div><!-- /wp:组--><!-- wp:group{“style”:{“spacing”:{-“padding”:}“top”:“var:preset|spacing|30”,“bottom”:“val:preset| spacing|10”,“left”:“var:preset | spacing |50”},“margin”:<div class=“wp-block-group has-base-2-background-color has-background”style=“margin-top:-65px;padding-top:var(--wp-preset--spacing--30);padding-right:var[--wp-preset--space--50);pading-bottom:varwp:段落--><p>第2组</p><!-- /wp:段落--><!-- wp:分隔符--><hr class=“wp-block-separtator has-alpha-channel-opacity”/><!-- /wp:分隔符--><!-- wp:段落--><p>Lorem ipsum悲哀坐在amet,奉献敬爱的精英。Sed sagittis libero posuere enim pellentesque,一个convallis mauris unmediate。埃涅安在lectus eu tortor luctus convallis。非舌间层最大Aliquam maximus。埃涅阿斯奉献给了梅特斯。Etiam sodales nec eros无效。Nullam libero urna,auctor vel ultrices sit amet,tincidunt vel lacus。Morbi ut ante risus公司。Morbi vulputate ante vel elit ultrices semper公司。最终莫尔比隐匿性疾病在各种疾病中传播。Interdum et malesuada在福克斯(faucibus)著名的“前伊普森·普里米斯”(ante ipsum primis)。Sed lectus arcu,ultrices vitae feugiat et,dapibus sit amet elit等。在ipsum ultrices porttitor euismod nec justo的nisi中的Nulla</p>(第页)<!-- /wp:段落--></div><!-- /wp:组--></div><!-- /wp:组-->

这很令人困惑,因为CSS正在做它应该做的事情,差异是因为我们在编辑器中添加了额外的CSS规则。另一方面,我们希望为用户提供一个开箱即用的解决方案。

@贾斯穆森
复制链接
贡献者

回顾整体行为,以下是GIF,描述如下:

行为测试

  • 两组有色人种相继出现。
  • 测试检查器中的边距控制,以调整最底部组的顶部边距。
  • 在输入中单击并拖动,作为快速递增/递减的快捷方式。
  • 选择每个组以在选中时将其置于前台。
  • 值得注意的是,选择块里面一组仍然保留起源在前台(按下has-child-selected添加以修复此问题)。
  • 在列表视图中选择允许选择完全遮挡的块。
  • 使用箭头键仍然可以单独选择每个块。

这就是过去努力停滞不前的地方:可以通过应用不幸的负边距来模糊块。然而,有了一些护栏,我会到达,我认为这可以向前推进:

  • 这在theme.json中已经实现了。它就在那里,所以UI中的限制是人为的。
  • 此PR中添加的“前置”行为直观地适用于画布和列表视图,即使选择了模糊父块的子块也是如此。
  • 这是一个要求很高的特性,它扩展了表达式的范围。

我们可以添加的简单护栏是调整shift+箭头键并在范围字段中单击+拖动,因此它仅适用于正值。也就是说,您必须手动输入负值。目前尚不清楚在本次公关中会发生什么,甚至在最初,如果重叠问题成为一个问题,它可能会成为一个被探讨的护栏。

@贾斯穆森
复制链接
贡献者

我们如何瞄准利润率为负的区块?添加类?

是的,这是一个棘手的问题。起初我的直觉是只输出位置:相对;内联,靠近负边距,如下所示:

边缘顶部:-65px;位置:相对;[...]

问题是,如果在组块上也应用了position sticky,那么内联CSS将赢得这场特殊性之战:

屏幕截图2024-04-02 11 42 19

我们可以使用!重要的,但这不太理想。

我想知道:由于Sticky目前是一个仅限组块的功能,而这是受影响的主要因素,我们是否应该简单地添加默认情况下相对于所有组的位置?或者这会使这个“默认”值产生误导吗?
位置下拉列表

另一种选择是位置:在每个区块上相对,但特异性低。或者,如前所述,允许这种差异发生。

让我用代码笔试试另一个想法。

@MaggieCabrera公司
复制链接
贡献者 作者

我认为这里首先要弄清楚除了组之外的其他块是否受此影响。让我来调查一下。正如我所说,Columns块不受影响,而设置为stack或row的group也不受影响。

@MaggieCabrera公司
复制链接
贡献者 作者

我认为这里首先要弄清楚除了组之外的其他块是否受此影响。让我来调查一下。正如我所说,Columns块不受影响,而设置为stack或row的group也不受影响。

另一种选择是仅在存在hasbackground类时应用相对位置

@贾斯穆森
复制链接
贡献者

任何有边距的块都会受到影响。下面是两段应用了背景的内容:
段落

我认为问题是我们应该如何/在多大程度上“解决”这个问题。我仍在考虑一些选项,并发现这些位置具有粘性、绝对性和相对性,它们实际上都解决了重叠问题。该问题仅在位置静止时发生。发件人快速测试笔,位置:静态:

静止的

位置:粘性
粘性的

位置:相对

相对的

当然,在正确的上下文中,sticky会像预期的那样随您向下滚动页面,这不太重要。让我继续修修补补。

@贾斯穆森
复制链接
贡献者

探索没有产生明智的解决方案。我们现在的处境是:

  • CSS很奇怪。当没有相对位置时,背景会堆叠,但其中的文本会混合在一起。
  • 如果我们添加了适当的护栏,即必须在边距输入中手动键入减号,那么对我来说,这就可以防止意外输入。
  • 最常见用例的快速修复方法是简单地应用位置:相对;指向Group块,如果使用该块,则将被sticky属性覆盖。段落仍然可以混合,但也可以。

我会很高兴看到以上内容。好奇你的想法,@巴德纳!

@安奈扎祖
复制链接
贡献者

想在@WordPress/extraction中添加标签以获得关注和反馈。这是一个长期以来一直被要求的功能,在这项工作进行的过程中,如果能得到一些早期的想法,那就太棒了。

@马克豪威尔斯迈德

使用内联CSS添加位置或zindex等复杂规则已经在一些情况下造成了显著的问题,因为内联规则很难通过主题/插件CSS覆盖。(#40159)

我肯定可以看到为更复杂的布局添加分层控件(即zindex)的用途,例如重叠的粘性元素,我认为这应该具有优先权,这样,这种逻辑不仅可以应用于粘性元素,还可以在处理负边距时使用。我认为负边距只是布局工具的一个方面,它允许在编辑器中管理重叠元素。这可能是更好的关注点,而不是现在就为这一需求添加一个解决方案,然后再对其进行重构。

@贾斯穆森
复制链接
贡献者

使用内联CSS添加位置或zindex等复杂规则已经在一些情况下造成了显著的问题,因为内联规则很难通过主题/插件CSS覆盖。

我倾向于在很高的层次上同意,这确实意味着整个区块在前端没有新的规则。

然而@马克豪威尔斯迈德你会反对添加吗位置:相对;总是指向组块本身?国际海事组织(IMO),它似乎几乎是一个群体:它事物,所以其中的任何元素都应该与该组相关。它可以解决80%可能发生的奇怪情况。

@马克豪威尔斯迈德
复制链接

@贾斯穆森我在为客户构建的主题中不时地将该规则添加到组块中,一般来说,这不会导致任何重大问题。然而,开发人员100%需要能够覆盖它,所以要么需要使用:其中,或通过附加的语义类名:在最佳情况下,仅当使用负边距时。在我的脑海中,我不确定这对组块上的新CSS网格功能有什么或是否有敲门效应。

@贾斯穆森
复制链接
贡献者

这确实会被添加只有块的组变量,而不是行、堆栈或网格,是的,我们可以使用哪里以最小化特异性。

这似乎是前进的道路,然后在这里或作为后续,任何对数字控制输入的限制都会将0作为“拖动以增加/减少”启示的底线。也许这应该作为一个单独的问题写下来,你觉得怎么样@MaggieCabrera公司? 从技术上讲,这与本次公关无关,主要是一个有利于此的护栏。

@MaggieCabrera公司
复制链接
贡献者 作者

这确实会被添加只有块的组变量,而不是行、堆栈或网格,是的,我们可以使用哪里以最小化特异性。

这似乎是前进的道路,然后在这里或作为后续,任何对数字控制输入的限制都会将0作为“拖动以增加/减少”启示的底线。也许这应该作为一个单独的问题写下来,你觉得怎么样@MaggieCabrera公司? 从技术上讲,这与本次公关无关,主要是一个有利于此的护栏。

所以我的理解是:

  • 我们使用:where更改相对位置以仅影响组块(而不是行、堆栈或网格)。
  • 在后续操作中将拖动更改为负数
  • 更新可视化工具以在单独的请购单上显示负边距

听起来不错。

总的来说,我认为随着CSS的改变,该公关将准备好进行审查和测试

@贾斯穆森
复制链接
贡献者

是的,听起来不错👍 👍 (编辑器只使用CSS对堆叠进行排序,我们保持原样)

希望其他人也有机会通过这种或那种方式参与进来。

@彩色电视机
复制链接
成员

彩色电视机 评论2024年4月3日

我想知道如果我们考虑为这个实现使用语义类,会有什么挑战或副作用。例子:.wp位置--相对.

显然,这引入了一个全新的类命名约定(.wp文件-)并可能引起进一步的争论。

我正在与一些失眠症作斗争,我很可能(不恰当地)将这个问题与一直存在的不稳定困境混为一谈.has背景在里面#43110.

基本上,我只是担心怎样我们介绍位置:相对以便尝试避免将来对Group块的向后兼容性/弃用挑战。然而,我相信@MaggieCabrera公司,@贾斯穆森@马克豪威尔斯迈德在他们现有的考虑中敏锐地意识到了这一点。❤️

我只是在大声思考,也许应该试着睡觉。🛌

@MaggieCabrera公司
复制链接
贡献者 作者

到目前为止,这看起来像是在为组块工作,但其他块没有按预期工作,主要是因为需要相对位置以及在它们上。这是一个添加列块的测试:

编辑:

截图2024-04-03,10 38 09

前端:

截图2024-04-03,10 38 20

@MaggieCabrera公司
复制链接
贡献者 作者

我想知道如果我们考虑为这个实现使用语义类,会有什么挑战或副作用。示例:“.wp-position--relative”。

显然,这引入了一个全新的类命名约定(“.wp-”),并可能引发进一步的争论。

我正在与一些失眠症作斗争,我很可能(不恰当地)将这个问题与“hasbackground”在#43110.

基本上,我只是担心怎样我们引入“position:relative”,以避免集团块未来的落后兼容性/弃用挑战。然而,我相信@MaggieCabrera公司,@贾斯穆森@马克豪威尔斯迈德在他们现有的考虑中敏锐地意识到了这一点。❤️

我只是在大声思考,也许应该试着睡觉。🛌

从向后兼容性的角度考虑,添加一个类可能会更糟糕,所以如果我们可以避免这种情况。。。如果我们找到更好的解决方案,并且目前的特异性尽可能低,那么我们在本公关中现有的CSS可以在未来删除

@马克豪威尔斯迈德

我坚信,将语义类名用于各种目的比直接放置在元素上的值更好,但我也认识到,在某些情况下,编辑器中设置的值必须内联放置在某些元素上。

围绕CSS实现进行了很多讨论:其中许多讨论总结如下#54033通过@cbirdsong公司。几年前,我还在#40159(评论)我能找到的其他参考资料是#41230#38719.

@彩色电视机
复制链接
成员

此外,我还没有通读#32644,但很容易看到后续的PR,它使用列表视图允许用户拖放具有负边距值的嵌套内部块,并让其更新z索引相应的值?🤔

@马克豪威尔斯迈德

很容易看到后续的PR,它使用列表视图允许用户拖放具有负边距值的嵌套内部块,并让其更新z索引相应的值?🤔

我不认为zindex可以自动设置;序列中的块有一些用法,这些块与它们的前身重叠连续元素。

@马克豪威尔斯迈德

关于这一点的其他想法:如果控件值/设置可以在编辑器中过滤,那么这将非常有用,这样主题和插件开发人员可以阻止在定制情况下设置负值。我们的主题和插件开发人员迫切需要更多的可重写性,因此这将是一个添加一些内容的绝佳机会。

@贾斯穆森
复制链接
贡献者

所有好主意!我确实想把这一点再回到手头的公关上,因为这是由一个非常强烈的愿望推动的,即允许在保证金控制中使用负值。我们能达到的最小公关是什么,我们相信在后续行动中可以修复的任何连锁效应都能得到解决?IMO,这是PR,允许负值并应用非常低的特异性位置:相对;块。你怎么认为?

@MaggieCabrera公司
复制链接
贡献者 作者

当块重叠时,我看到编辑器和前端之间的区别:

我们在组块中包含了对此的修复,但决定不再扩展。剩下的街区,这是乔恩说的

复制链接
贡献者

@德拉加内斯库 德拉加内斯库 留下了评论

选择隐藏此评论的原因

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

我已经在带有负边距的各种分组块上手动测试了拖放。这个PR并没有真正打破它,但它确实做到了,所以drop只会附加到z索引较高的块。

我还成功地将图像块放在引号块后面,然后我无法选择图像。。。

@邋遢鬼 邋遢鬼合并提交aa5科进入之内 大旅行箱 2024年4月22日
63项检查通过
@邋遢鬼 邋遢鬼删除了 try-负边距 分支 2024年4月22日15:45
@github-操作 github-操作 机器人程序将此添加到古腾堡18.3里程碑2024年4月22日
@米尔卡
复制链接
成员

👋 我注意到对BoxControl的更改与一个看起来错误的更改日志条目合并,并且有一个看似无意/不必要的破坏性更改。

明确地,这个变化打破输入属性道具。看起来我们本可以通过inputProps={{min:-Infinity}}不更改BoxControl中的代码?我不确定我是否理解动机,但我们至少需要恢复破坏性的更改部分。

@MaggieCabrera公司
复制链接
贡献者 作者

👋 我注意到,对BoxControl的更改与一个看起来错误的更改日志条目合并,并且有一个看似无意/不必要的破坏性更改。

明确地,这个变化打破输入属性道具。看起来我们本可以通过inputProps={{min:-Infinity}}不更改BoxControl中的代码?我不确定我是否理解其中的动机,但我们至少需要恢复突破性的改变部分。

嘿!我不知道是什么坏了!你能解释一下吗?

我确实做了你所要求的回复,你的解决方案比我尝试的要简单得多,但我基本上是在尝试做同样的事情。如果你能复习一下PR描述并帮助我,因为我不知道我们首先破坏了什么(组件在主干中对我起作用):#60984

@米勒克里斯
复制链接

嘿,伙计们,我们知道什么时候会变成核心吗?

@前列腺增生
复制链接
贡献者

对。WordPress 6.6计划于2024年7月26日发布

免费注册 在GitHub上加入此对话.已经有帐户了吗?登录以发表评论
标签
全球风格 与更广泛的Global Styles工作相关的任何内容,包括Styles Engine和theme.json 需要辅助功能反馈 需要可访问性的输入 [类型]增强功能 改进建议。
项目
已在项目中存档
开发

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

尺寸控制中的负边距