@wordpress/block-library 7.14.2 → 7.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/build/comments-pagination-next/index.js +1 -1
  2. package/build/comments-pagination-numbers/index.js +1 -1
  3. package/build/comments-pagination-previous/index.js +1 -1
  4. package/build/gallery/deprecated.js +4 -4
  5. package/build/gallery/deprecated.js.map +1 -1
  6. package/build/navigation/edit/index.js +12 -12
  7. package/build/navigation/edit/index.js.map +1 -1
  8. package/build/navigation/menu-items-to-blocks.js +16 -6
  9. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  10. package/build/post-content/edit.js +6 -1
  11. package/build/post-content/edit.js.map +1 -1
  12. package/build/post-featured-image/index.js +1 -1
  13. package/build/post-featured-image/overlay.js +2 -2
  14. package/build/post-featured-image/overlay.js.map +1 -1
  15. package/build/post-template/edit.js +13 -28
  16. package/build/post-template/edit.js.map +1 -1
  17. package/build/query/edit/inspector-controls/index.js +1 -1
  18. package/build/query/edit/inspector-controls/index.js.map +1 -1
  19. package/build/query/utils.js +1 -1
  20. package/build/query/utils.js.map +1 -1
  21. package/build/quote/index.js +0 -1
  22. package/build/quote/index.js.map +1 -1
  23. package/build/quote/transforms.js +2 -2
  24. package/build/quote/transforms.js.map +1 -1
  25. package/build/template-part/edit/index.js +2 -2
  26. package/build/template-part/edit/index.js.map +1 -1
  27. package/build/template-part/index.js +2 -2
  28. package/build/template-part/index.js.map +1 -1
  29. package/build-module/comments-pagination-next/index.js +1 -1
  30. package/build-module/comments-pagination-numbers/index.js +1 -1
  31. package/build-module/comments-pagination-previous/index.js +1 -1
  32. package/build-module/gallery/deprecated.js +4 -4
  33. package/build-module/gallery/deprecated.js.map +1 -1
  34. package/build-module/navigation/edit/index.js +12 -12
  35. package/build-module/navigation/edit/index.js.map +1 -1
  36. package/build-module/navigation/menu-items-to-blocks.js +16 -6
  37. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  38. package/build-module/post-content/edit.js +6 -1
  39. package/build-module/post-content/edit.js.map +1 -1
  40. package/build-module/post-featured-image/index.js +1 -1
  41. package/build-module/post-featured-image/overlay.js +2 -2
  42. package/build-module/post-featured-image/overlay.js.map +1 -1
  43. package/build-module/post-template/edit.js +14 -29
  44. package/build-module/post-template/edit.js.map +1 -1
  45. package/build-module/query/edit/inspector-controls/index.js +1 -1
  46. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  47. package/build-module/query/utils.js +1 -1
  48. package/build-module/query/utils.js.map +1 -1
  49. package/build-module/quote/index.js +0 -1
  50. package/build-module/quote/index.js.map +1 -1
  51. package/build-module/quote/transforms.js +2 -2
  52. package/build-module/quote/transforms.js.map +1 -1
  53. package/build-module/template-part/edit/index.js +3 -3
  54. package/build-module/template-part/edit/index.js.map +1 -1
  55. package/build-module/template-part/index.js +2 -2
  56. package/build-module/template-part/index.js.map +1 -1
  57. package/build-style/classic-rtl.css +85 -0
  58. package/build-style/classic.css +85 -0
  59. package/build-style/code/style-rtl.css +3 -0
  60. package/build-style/code/style.css +3 -0
  61. package/build-style/editor-rtl.css +39 -29
  62. package/build-style/editor.css +39 -29
  63. package/build-style/post-featured-image/editor-rtl.css +39 -29
  64. package/build-style/post-featured-image/editor.css +39 -29
  65. package/build-style/style-rtl.css +3 -0
  66. package/build-style/style.css +3 -0
  67. package/package.json +12 -12
  68. package/src/classic.scss +15 -0
  69. package/src/code/style.scss +12 -7
  70. package/src/comment-template/index.php +18 -8
  71. package/src/comments-pagination-next/block.json +1 -1
  72. package/src/comments-pagination-numbers/block.json +1 -1
  73. package/src/comments-pagination-previous/block.json +1 -1
  74. package/src/gallery/deprecated.js +4 -4
  75. package/src/navigation/edit/index.js +12 -10
  76. package/src/navigation/menu-items-to-blocks.js +39 -22
  77. package/src/navigation/test/menu-items-to-blocks.js +6 -0
  78. package/src/navigation-submenu/index.php +10 -1
  79. package/src/post-content/edit.js +3 -1
  80. package/src/post-featured-image/block.json +1 -1
  81. package/src/post-featured-image/editor.scss +79 -72
  82. package/src/post-featured-image/index.php +18 -24
  83. package/src/post-featured-image/overlay.js +17 -14
  84. package/src/post-template/edit.js +14 -23
  85. package/src/query/edit/inspector-controls/index.js +1 -4
  86. package/src/query/utils.js +1 -1
  87. package/src/quote/block.json +0 -1
  88. package/src/quote/transforms.js +1 -1
  89. package/src/template-part/edit/index.js +60 -58
  90. package/src/template-part/index.js +2 -2
@@ -277,6 +277,9 @@
277
277
  margin-left: 2em;
278
278
  }
279
279
 
280
+ .wp-block-code {
281
+ box-sizing: border-box;
282
+ }
280
283
  .wp-block-code code {
281
284
  display: block;
282
285
  font-family: inherit;
@@ -280,6 +280,9 @@
280
280
  margin-left: 2em;
281
281
  }
282
282
 
283
+ .wp-block-code {
284
+ box-sizing: border-box;
285
+ }
283
286
  .wp-block-code code {
284
287
  display: block;
285
288
  font-family: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.14.2",
3
+ "version": "7.14.4",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,12 +35,12 @@
35
35
  "@wordpress/api-fetch": "^6.14.1",
36
36
  "@wordpress/autop": "^3.17.1",
37
37
  "@wordpress/blob": "^3.17.1",
38
- "@wordpress/block-editor": "^10.0.2",
39
- "@wordpress/blocks": "^11.16.2",
40
- "@wordpress/components": "^21.0.2",
38
+ "@wordpress/block-editor": "^10.0.4",
39
+ "@wordpress/blocks": "^11.16.4",
40
+ "@wordpress/components": "^21.0.4",
41
41
  "@wordpress/compose": "^5.15.2",
42
- "@wordpress/core-data": "^5.0.2",
43
- "@wordpress/data": "^7.1.2",
42
+ "@wordpress/core-data": "^5.0.4",
43
+ "@wordpress/data": "^7.1.3",
44
44
  "@wordpress/date": "^4.17.1",
45
45
  "@wordpress/deprecated": "^3.17.1",
46
46
  "@wordpress/dom": "^3.17.2",
@@ -50,13 +50,13 @@
50
50
  "@wordpress/i18n": "^4.17.1",
51
51
  "@wordpress/icons": "^9.8.1",
52
52
  "@wordpress/keycodes": "^3.17.1",
53
- "@wordpress/notices": "^3.17.2",
53
+ "@wordpress/notices": "^3.17.3",
54
54
  "@wordpress/primitives": "^3.15.1",
55
- "@wordpress/reusable-blocks": "^3.15.2",
56
- "@wordpress/rich-text": "^5.15.2",
57
- "@wordpress/server-side-render": "^3.15.2",
55
+ "@wordpress/reusable-blocks": "^3.15.4",
56
+ "@wordpress/rich-text": "^5.15.3",
57
+ "@wordpress/server-side-render": "^3.15.4",
58
58
  "@wordpress/url": "^3.18.1",
59
- "@wordpress/viewport": "^4.15.2",
59
+ "@wordpress/viewport": "^4.15.3",
60
60
  "change-case": "^4.1.2",
61
61
  "classnames": "^2.3.1",
62
62
  "colord": "^2.7.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "f6021282457317c7e12dcc3a3f02c9ac28e16a30"
76
+ "gitHead": "491b4b522dffb4d25aca066ec55500f456ac4aa3"
77
77
  }
@@ -0,0 +1,15 @@
1
+ // These rules are needed for backwards compatibility.
2
+ .wp-block-button__link {
3
+ color: $white;
4
+ background-color: #32373c;
5
+ border-radius: 9999px; // 100% causes an oval, but any explicit but really high value retains the pill shape.
6
+
7
+ // This needs a low specificity so it won't override the rules from the button element if defined in theme.json.
8
+ box-shadow: none;
9
+ text-decoration: none;
10
+
11
+ // The extra 2px are added to size solids the same as the outline versions.
12
+ padding: calc(0.667em + 2px) calc(1.333em + 2px);
13
+
14
+ font-size: 1.125em;
15
+ }
@@ -1,8 +1,13 @@
1
- // Provide a minimum of overflow handling and ensure the code markup inherits
2
- // the font-family set on pre.
3
- .wp-block-code code {
4
- display: block;
5
- font-family: inherit;
6
- overflow-wrap: break-word;
7
- white-space: pre-wrap;
1
+ .wp-block-code {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+
5
+ // Provide a minimum of overflow handling and ensure the code markup inherits
6
+ // the font-family set on pre.
7
+ code {
8
+ display: block;
9
+ font-family: inherit;
10
+ overflow-wrap: break-word;
11
+ white-space: pre-wrap;
12
+ }
8
13
  }
@@ -16,6 +16,8 @@
16
16
  */
17
17
  function block_core_comment_template_render_comments( $comments, $block ) {
18
18
  global $comment_depth;
19
+ $thread_comments = get_option( 'thread_comments' );
20
+ $thread_comments_depth = get_option( 'thread_comments_depth' );
19
21
 
20
22
  if ( empty( $comment_depth ) ) {
21
23
  $comment_depth = 1;
@@ -46,14 +48,22 @@ function block_core_comment_template_render_comments( $comments, $block ) {
46
48
 
47
49
  // If the comment has children, recurse to create the HTML for the nested
48
50
  // comments.
49
- if ( ! empty( $children ) ) {
50
- $comment_depth += 1;
51
- $inner_content = block_core_comment_template_render_comments(
52
- $children,
53
- $block
54
- );
55
- $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
56
- $comment_depth -= 1;
51
+ if ( ! empty( $children ) && ! empty( $thread_comments ) ) {
52
+ if ( $comment_depth < $thread_comments_depth ) {
53
+ $comment_depth += 1;
54
+ $inner_content = block_core_comment_template_render_comments(
55
+ $children,
56
+ $block
57
+ );
58
+ $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
59
+ $comment_depth -= 1;
60
+ } else {
61
+ $inner_content = block_core_comment_template_render_comments(
62
+ $children,
63
+ $block
64
+ );
65
+ $block_content .= sprintf( $inner_content );
66
+ }
57
67
  }
58
68
 
59
69
  $content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content );
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 2,
4
4
  "name": "core/comments-pagination-next",
5
- "title": "Next Page",
5
+ "title": "Comments Next Page",
6
6
  "category": "theme",
7
7
  "parent": [ "core/comments-pagination" ],
8
8
  "description": "Displays the next comment's page link.",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 2,
4
4
  "name": "core/comments-pagination-numbers",
5
- "title": "Page Numbers",
5
+ "title": "Comments Page Numbers",
6
6
  "category": "theme",
7
7
  "parent": [ "core/comments-pagination" ],
8
8
  "description": "Displays a list of page numbers for comments pagination.",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
3
  "apiVersion": 2,
4
4
  "name": "core/comments-pagination-previous",
5
- "title": "Previous Page",
5
+ "title": "Comments Previous Page",
6
6
  "category": "theme",
7
7
  "parent": [ "core/comments-pagination" ],
8
8
  "description": "Displays the previous comment's page link.",
@@ -659,8 +659,8 @@ const v3 = {
659
659
  attribute: 'data-link',
660
660
  },
661
661
  caption: {
662
- type: 'array',
663
- source: 'children',
662
+ type: 'string',
663
+ source: 'html',
664
664
  selector: 'figcaption',
665
665
  },
666
666
  },
@@ -779,8 +779,8 @@ const v2 = {
779
779
  attribute: 'data-link',
780
780
  },
781
781
  caption: {
782
- type: 'array',
783
- source: 'children',
782
+ type: 'string',
783
+ source: 'html',
784
784
  selector: 'figcaption',
785
785
  },
786
786
  },
@@ -282,16 +282,18 @@ function Navigation( {
282
282
  hasResolvedNavigationMenus &&
283
283
  ! hasUncontrolledInnerBlocks;
284
284
 
285
- if ( isPlaceholder && ! ref ) {
286
- /**
287
- * this fallback only displays (both in editor and on front)
288
- * the list of pages block if no menu is available as a fallback.
289
- * We don't want the fallback to request a save,
290
- * nor to be undoable, hence we mark it non persistent.
291
- */
292
- __unstableMarkNextChangeAsNotPersistent();
293
- replaceInnerBlocks( clientId, [ createBlock( 'core/page-list' ) ] );
294
- }
285
+ useEffect( () => {
286
+ if ( isPlaceholder && ! ref ) {
287
+ /**
288
+ * this fallback only displays (both in editor and on front)
289
+ * the list of pages block if no menu is available as a fallback.
290
+ * We don't want the fallback to request a save,
291
+ * nor to be undoable, hence we mark it non persistent.
292
+ */
293
+ __unstableMarkNextChangeAsNotPersistent();
294
+ replaceInnerBlocks( clientId, [ createBlock( 'core/page-list' ) ] );
295
+ }
296
+ }, [ clientId, isPlaceholder, ref ] );
295
297
 
296
298
  const isEntityAvailable =
297
299
  ! isNavigationMenuMissing && isNavigationMenuResolved;
@@ -29,9 +29,10 @@ export default function menuItemsToBlocks( menuItems ) {
29
29
  * A recursive function that maps menu item nodes to blocks.
30
30
  *
31
31
  * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items.
32
+ * @param {number} level An integer representing the nesting level.
32
33
  * @return {Object} Object containing innerBlocks and mapping.
33
34
  */
34
- function mapMenuItemsToBlocks( menuItems ) {
35
+ function mapMenuItemsToBlocks( menuItems, level = 0 ) {
35
36
  let mapping = {};
36
37
 
37
38
  // The menuItem should be in menu_order sort order.
@@ -52,14 +53,22 @@ function mapMenuItemsToBlocks( menuItems ) {
52
53
  return block;
53
54
  }
54
55
 
55
- const attributes = menuItemToBlockAttributes( menuItem );
56
+ const blockType = menuItem.children?.length
57
+ ? 'core/navigation-submenu'
58
+ : 'core/navigation-link';
59
+
60
+ const attributes = menuItemToBlockAttributes(
61
+ menuItem,
62
+ blockType,
63
+ level
64
+ );
56
65
 
57
66
  // If there are children recurse to build those nested blocks.
58
67
  const {
59
68
  innerBlocks: nestedBlocks = [], // alias to avoid shadowing
60
69
  mapping: nestedMapping = {}, // alias to avoid shadowing
61
70
  } = menuItem.children?.length
62
- ? mapMenuItemsToBlocks( menuItem.children )
71
+ ? mapMenuItemsToBlocks( menuItem.children, level + 1 )
63
72
  : {};
64
73
 
65
74
  // Update parent mapping with nested mapping.
@@ -68,10 +77,6 @@ function mapMenuItemsToBlocks( menuItems ) {
68
77
  ...nestedMapping,
69
78
  };
70
79
 
71
- const blockType = menuItem.children?.length
72
- ? 'core/navigation-submenu'
73
- : 'core/navigation-link';
74
-
75
80
  // Create block with nested "innerBlocks".
76
81
  const block = createBlock( blockType, attributes, nestedBlocks );
77
82
 
@@ -111,23 +116,29 @@ function mapMenuItemsToBlocks( menuItems ) {
111
116
  /**
112
117
  * Convert block attributes to menu item.
113
118
  *
114
- * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
119
+ * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes.
120
+ * @param {string} blockType The block type.
121
+ * @param {number} level An integer representing the nesting level.
115
122
  * @return {Object} the block attributes converted from the WPNavMenuItem item.
116
123
  */
117
- function menuItemToBlockAttributes( {
118
- title: menuItemTitleField,
119
- xfn,
120
- classes,
121
- // eslint-disable-next-line camelcase
122
- attr_title,
123
- object,
124
- // eslint-disable-next-line camelcase
125
- object_id,
126
- description,
127
- url,
128
- type: menuItemTypeField,
129
- target,
130
- } ) {
124
+ function menuItemToBlockAttributes(
125
+ {
126
+ title: menuItemTitleField,
127
+ xfn,
128
+ classes,
129
+ // eslint-disable-next-line camelcase
130
+ attr_title,
131
+ object,
132
+ // eslint-disable-next-line camelcase
133
+ object_id,
134
+ description,
135
+ url,
136
+ type: menuItemTypeField,
137
+ target,
138
+ },
139
+ blockType,
140
+ level
141
+ ) {
131
142
  // For historical reasons, the `core/navigation-link` variation type is `tag`
132
143
  // whereas WP Core expects `post_tag` as the `object` type.
133
144
  // To avoid writing a block migration we perform a conversion here.
@@ -166,6 +177,12 @@ function menuItemToBlockAttributes( {
166
177
  ...( target === '_blank' && {
167
178
  opensInNewTab: true,
168
179
  } ),
180
+ ...( blockType === 'core/navigation-submenu' && {
181
+ isTopLevelItem: level === 0,
182
+ } ),
183
+ ...( blockType === 'core/navigation-link' && {
184
+ isTopLevelLink: level === 0,
185
+ } ),
169
186
  };
170
187
  }
171
188
 
@@ -189,12 +189,14 @@ describe( 'converting menu items to blocks', () => {
189
189
  name: 'core/navigation-submenu',
190
190
  attributes: expect.objectContaining( {
191
191
  label: 'Top Level',
192
+ isTopLevelItem: true,
192
193
  } ),
193
194
  innerBlocks: [
194
195
  expect.objectContaining( {
195
196
  name: 'core/navigation-link',
196
197
  attributes: expect.objectContaining( {
197
198
  label: 'Child 1',
199
+ isTopLevelLink: false,
198
200
  } ),
199
201
  innerBlocks: [],
200
202
  } ),
@@ -202,18 +204,21 @@ describe( 'converting menu items to blocks', () => {
202
204
  name: 'core/navigation-submenu',
203
205
  attributes: expect.objectContaining( {
204
206
  label: 'Child 2',
207
+ isTopLevelItem: false,
205
208
  } ),
206
209
  innerBlocks: [
207
210
  expect.objectContaining( {
208
211
  name: 'core/navigation-submenu',
209
212
  attributes: expect.objectContaining( {
210
213
  label: 'Sub Child',
214
+ isTopLevelItem: false,
211
215
  } ),
212
216
  innerBlocks: [
213
217
  expect.objectContaining( {
214
218
  name: 'core/navigation-link',
215
219
  attributes: expect.objectContaining( {
216
220
  label: 'Sub Sub Child',
221
+ isTopLevelLink: false,
217
222
  } ),
218
223
  innerBlocks: [],
219
224
  } ),
@@ -227,6 +232,7 @@ describe( 'converting menu items to blocks', () => {
227
232
  name: 'core/navigation-link',
228
233
  attributes: expect.objectContaining( {
229
234
  label: 'Top Level 2',
235
+ isTopLevelLink: true,
230
236
  } ),
231
237
  innerBlocks: [],
232
238
  } ),
@@ -183,7 +183,16 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
183
183
  if ( ! $open_on_click ) {
184
184
  $item_url = isset( $attributes['url'] ) ? $attributes['url'] : '';
185
185
  // Start appending HTML attributes to anchor tag.
186
- $html .= '<a class="wp-block-navigation-item__content" href="' . esc_url( $item_url ) . '"';
186
+ $html .= '<a class="wp-block-navigation-item__content"';
187
+
188
+ // The href attribute on a and area elements is not required;
189
+ // when those elements do not have href attributes they do not create hyperlinks.
190
+ // But also The href attribute must have a value that is a valid URL potentially
191
+ // surrounded by spaces.
192
+ // see: https://html.spec.whatwg.org/multipage/links.html#links-created-by-a-and-area-elements.
193
+ if ( ! empty( $item_url ) ) {
194
+ $html .= ' href="' . esc_url( $item_url ) . '"';
195
+ }
187
196
 
188
197
  if ( $is_active ) {
189
198
  $html .= ' aria-current="page"';
@@ -46,7 +46,9 @@ function EditableContent( { layout, context = {} } ) {
46
46
  return getSettings()?.supportsLayout;
47
47
  }, [] );
48
48
  const defaultLayout = useSetting( 'layout' ) || {};
49
- const usedLayout = !! layout && layout.inherit ? defaultLayout : layout;
49
+ const usedLayout = ! layout?.type
50
+ ? { ...defaultLayout, ...layout, type: 'default' }
51
+ : { ...defaultLayout, ...layout };
50
52
  const [ blocks, onInput, onChange ] = useEntityBlockEditor(
51
53
  'postType',
52
54
  postType,
@@ -62,7 +62,7 @@
62
62
  "color": true,
63
63
  "radius": true,
64
64
  "width": true,
65
- "__experimentalSelector": "img, .block-editor-media-placeholder",
65
+ "__experimentalSelector": "img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay",
66
66
  "__experimentalSkipSerialization": true,
67
67
  "__experimentalDefaultControls": {
68
68
  "color": true,
@@ -6,87 +6,94 @@
6
6
  backdrop-filter: none; // Removes background blur so the overlay's actual color is visible.
7
7
  }
8
8
 
9
- &.wp-block-post-featured-image {
10
- // Style the placeholder.
11
- .wp-block-post-featured-image__placeholder,
12
- .components-placeholder {
13
- justify-content: center;
14
- align-items: center;
15
- padding: 0;
9
+ // Style the placeholder.
10
+ .wp-block-post-featured-image__placeholder,
11
+ .components-placeholder {
12
+ justify-content: center;
13
+ align-items: center;
14
+ padding: 0;
16
15
 
17
- // Hide the upload button, as it's also available in the media library.
18
- .components-form-file-upload {
19
- display: none;
20
- }
16
+ // Hide the upload button, as it's also available in the media library.
17
+ .components-form-file-upload {
18
+ display: none;
19
+ }
21
20
 
22
- // Style the upload button.
23
- .components-button.components-button {
24
- padding: 0;
25
- display: flex;
26
- justify-content: center;
27
- align-items: center;
28
- width: $grid-unit-60;
29
- height: $grid-unit-60;
30
- border-radius: 50%;
31
- position: relative;
32
- background: var(--wp-admin-theme-color);
33
- border-color: var(--wp-admin-theme-color);
34
- border-style: solid;
35
- color: $white;
21
+ // Style the upload button.
22
+ .components-button {
23
+ padding: 0;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ width: $grid-unit-60;
28
+ height: $grid-unit-60;
29
+ border-radius: 50%;
30
+ position: relative;
31
+ background: var(--wp-admin-theme-color);
32
+ border-color: var(--wp-admin-theme-color);
33
+ border-style: solid;
34
+ color: $white;
36
35
 
37
- > svg {
38
- color: inherit;
39
- }
36
+ > svg {
37
+ color: inherit;
40
38
  }
39
+ }
41
40
 
42
- // Show default placeholder height when not resized.
43
- min-height: 200px;
44
-
45
- // The following override the default placeholder styles that remove
46
- // its border so that a user selection for border color or width displays
47
- // a visual border.
48
- &:where(.has-border-color) {
49
- border-style: solid;
50
- }
51
- &:where([style*="border-top-color"]) {
52
- border-top-style: solid;
53
- }
54
- &:where([style*="border-right-color"]) {
55
- border-right-style: solid;
56
- }
57
- &:where([style*="border-bottom-color"]) {
58
- border-bottom-style: solid;
59
- }
60
- &:where([style*="border-left-color"]) {
61
- border-left-style: solid;
62
- }
41
+ // Show default placeholder height when not resized.
42
+ min-height: 200px;
43
+ }
63
44
 
64
- &:where([style*="border-width"]) {
65
- border-style: solid;
66
- }
67
- &:where([style*="border-top-width"]) {
68
- border-top-style: solid;
69
- }
70
- &:where([style*="border-right-width"]) {
71
- border-right-style: solid;
72
- }
73
- &:where([style*="border-bottom-width"]) {
74
- border-bottom-style: solid;
75
- }
76
- &:where([style*="border-left-width"]) {
77
- border-left-style: solid;
78
- }
45
+ // The following override the default placeholder styles that remove
46
+ // its border so that a user selection for border color or width displays
47
+ // a visual border. They also override the `img { border: none; }` applied
48
+ // by core.
49
+ .wp-block-post-featured-image__placeholder,
50
+ .components-placeholder,
51
+ img {
52
+ // The following is required to overcome WP Core applying styles that clear
53
+ // img borders with a higher specificity than those added by the border
54
+ // block support to provide a default border-style of solid when a border
55
+ // color or width has been set.
56
+ &:where(.has-border-color) {
57
+ border-style: solid;
58
+ }
59
+ &:where([style*="border-top-color"]) {
60
+ border-top-style: solid;
61
+ }
62
+ &:where([style*="border-right-color"]) {
63
+ border-right-style: solid;
64
+ }
65
+ &:where([style*="border-bottom-color"]) {
66
+ border-bottom-style: solid;
67
+ }
68
+ &:where([style*="border-left-color"]) {
69
+ border-left-style: solid;
79
70
  }
80
71
 
81
- // Provide a minimum size for the placeholder when resized.
82
- // Note, this should be as small as we can afford it, and exists only
83
- // to ensure there's room for the upload button.
84
- &[style*="height"] .components-placeholder {
85
- min-height: $grid-unit-60;
86
- min-width: $grid-unit-60;
87
- height: 100%;
88
- width: 100%;
72
+ &:where([style*="border-width"]) {
73
+ border-style: solid;
74
+ }
75
+ &:where([style*="border-top-width"]) {
76
+ border-top-style: solid;
77
+ }
78
+ &:where([style*="border-right-width"]) {
79
+ border-right-style: solid;
89
80
  }
81
+ &:where([style*="border-bottom-width"]) {
82
+ border-bottom-style: solid;
83
+ }
84
+ &:where([style*="border-left-width"]) {
85
+ border-left-style: solid;
86
+ }
87
+ }
88
+
89
+ // Provide a minimum size for the placeholder when resized.
90
+ // Note, this should be as small as we can afford it, and exists only
91
+ // to ensure there's room for the upload button.
92
+ &[style*="height"] .components-placeholder {
93
+ min-height: $grid-unit-60;
94
+ min-width: $grid-unit-60;
95
+ height: 100%;
96
+ width: 100%;
90
97
  }
91
98
  }
92
99