Skip to content

Commit 5b64bfb

Browse files
Gallery: Add duotone support
1 parent c1dd881 commit 5b64bfb

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎docs/reference-guides/core-blocks/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Display multiple images in a rich gallery.
357357
- **Name:** [core/gallery](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/core-block-gallery/)
358358
- **Category:** [media](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-media/)
359359
- **Allowed Blocks:** core/image
360-
- **Supports:** align, anchor, background (backgroundImage, backgroundSize, gradient), color (background, gradients, ~~text~~), interactivity (clientNavigation), layout (allowEditing, allowSizingOnChildren, default, ~~allowInheriting~~, ~~allowJustification~~, ~~allowOrientation~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~, ~~allowWrap~~), listView, spacing (blockGap, margin, padding), units (em, px, rem, vh, vw), ~~html~~
360+
- **Supports:** align, anchor, background (backgroundImage, backgroundSize, gradient), color (background, gradients, ~~text~~), filter (duotone), interactivity (clientNavigation), layout (allowEditing, allowSizingOnChildren, default, ~~allowInheriting~~, ~~allowJustification~~, ~~allowOrientation~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~, ~~allowWrap~~), listView, spacing (blockGap, margin, padding), units (em, px, rem, vh, vw), ~~html~~
361361
- **Attributes:** allowResize, aspectRatio, caption, columns, dynamicContent, fixedHeight, ids, imageCrop, images, linkTarget, linkTo, navigationButtonType, randomOrder, shortCodeTransforms, sizeSlug
362362

363363
## Group

‎packages/block-library/src/gallery/README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
6666
- [`allowWrap`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowwrap): `false`
6767
- [`allowSizingOnChildren`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-allowsizingonchildren): `true`
6868
- [`default`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#layout-default): `{"type":"flex"}`
69+
- [`filter`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter):
70+
- [`duotone`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#filter-duotone): `true`
6971
- [`interactivity`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity):
7072
- `clientNavigation`: `true`
7173
- [`listView`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#listview): `true`
@@ -87,6 +89,13 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
8789
- `fixedHeight` → attribute `fixedHeight`
8890
- `navigationButtonType` → attribute `navigationButtonType`
8991

92+
## CSS Selectors
93+
94+
_Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._
95+
96+
- **filter**:
97+
- duotone: `.wp-block-gallery :where(img)`
98+
9099
## Block Markup
91100

92101
This is a [**hybrid block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). It saves static markup that the server may enhance during rendering.

‎packages/block-library/src/gallery/block.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,19 @@
179179
"type": "flex"
180180
}
181181
},
182+
"filter": {
183+
"duotone": true
184+
},
182185
"interactivity": {
183186
"clientNavigation": true
184187
},
185188
"listView": true
186189
},
190+
"selectors": {
191+
"filter": {
192+
"duotone": ".wp-block-gallery :where(img)"
193+
}
194+
},
187195
"editorStyle": "wp-block-gallery-editor",
188196
"style": "wp-block-gallery"
189197
}

0 commit comments

Comments
 (0)