Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Settings related to colors.
| heading | Allow users to set heading colors in a block. | `boolean` | `true` |
| button | Allow users to set button colors in a block. | `boolean` | `true` |
| caption | Allow users to set caption colors in a block. | `boolean` | `true` |
| label | Allow users to set label colors in a block. | `boolean` | `true` |

---

Expand Down
1 change: 1 addition & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ private static function sanitize_viewport_settings( $viewport_settings ) {
// The block classes are necessary to target older content that won't use the new class names.
'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
'cite' => 'cite',
'label' => 'label',
Comment thread
sarthaknagoshe2002 marked this conversation as resolved.
Resolved
'select' => 'select',
'textInput' => 'textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=text],[type=tel],[type=url])',
);
Expand Down
6 changes: 2 additions & 4 deletions packages/block-library/src/archives/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
box-sizing: border-box;
}

.wp-block-archives-dropdown {
label {
display: block;
}
:where(.wp-block-archives-dropdown label) {
display: block;
Comment thread
sarthaknagoshe2002 marked this conversation as resolved.
Resolved
}
8 changes: 4 additions & 4 deletions packages/block-library/src/categories/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
&.wp-block-categories-dropdown.aligncenter {
text-align: center;
}
& .wp-block-categories__label:not(.screen-reader-text) {
width: 100%;
display: block;
}
}
:where(.wp-block-categories__label:not(.screen-reader-text)) {
width: 100%;
display: block;
}
4 changes: 2 additions & 2 deletions packages/block-library/src/form-input/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.wp-block-form-input__label {
:where(.wp-block-form-input__label) {
width: 100%;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -30,7 +30,7 @@
}
}

.wp-block-form-input__label-content {
:where(.wp-block-form-input__label-content) {
width: fit-content;
}

Expand Down
12 changes: 5 additions & 7 deletions packages/block-library/src/post-comments-form/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@
}
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
label {
display: block;
margin-bottom: 0.25em;
}
:where(.wp-block-post-comments-form .comment-form-author label),
:where(.wp-block-post-comments-form .comment-form-email label),
:where(.wp-block-post-comments-form .comment-form-url label) {
Comment thread
sarthaknagoshe2002 marked this conversation as resolved.
Resolved
display: block;
margin-bottom: 0.25em;
}

.comment-form-cookies-consent {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/search/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
max-width: 100%;
}

.wp-block-search__label {
:where(.wp-block-search__label) {
width: 100%;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/block-library/src/search/theme.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.wp-block-search {
.wp-block-search__label {
font-weight: bold;
}
:where(.wp-block-search .wp-block-search__label) {
font-weight: bold;
}

.wp-block-search__button {
Expand Down
1 change: 1 addition & 0 deletions packages/blocks/src/api/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export const __EXPERIMENTAL_ELEMENTS: Record< string, string > = {
caption:
'.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
cite: 'cite',
label: 'label',
select: 'select',
textInput:
'textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])',
Expand Down
8 changes: 8 additions & 0 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@
"description": "Allow users to set caption colors in a block.",
"type": "boolean",
"default": true
},
"label": {
"description": "Allow users to set label colors in a block.",
"type": "boolean",
"default": true
Comment thread
sarthaknagoshe2002 marked this conversation as resolved.
Resolved
}
},
"additionalProperties": false
Expand Down Expand Up @@ -2300,6 +2305,9 @@
}
]
},
"label": {
"$ref": "#/definitions/stylesPropertiesComplete"
},
Comment on lines +2371 to +2373

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I intentionally used the simpler stylesPropertiesComplete reference here.

If we inject the allOf block for label, it causes the test fixtures to fail.

I'd prefer to keep this as stylesPropertiesComplete to keep the unit tests green, unless we want to expand the scope of this PR to update the core test fixtures to support responsive element refs.

"select": {
"allOf": [
{
Expand Down
Loading