diff --git a/packages/block-library/src/gallery/index.js b/packages/block-library/src/gallery/index.js index 59a2ab2673cb60..0bbd2fe3098150 100644 --- a/packages/block-library/src/gallery/index.js +++ b/packages/block-library/src/gallery/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __ } from '@wordpress/i18n'; +import { __, _x } from '@wordpress/i18n'; import { gallery as icon } from '@wordpress/icons'; /** @@ -22,6 +22,17 @@ export const settings = { description: __( 'Display multiple images in a rich gallery.' ), icon, keywords: [ __( 'images' ), __( 'photos' ) ], + styles: [ + { + name: 'default', + label: _x( 'Default', 'block style' ), + isDefault: true, + }, + { + name: 'white-caption-background', + label: _x( 'White caption background', 'block style' ), + }, + ], example: { attributes: { columns: 2, diff --git a/packages/block-library/src/gallery/style.scss b/packages/block-library/src/gallery/style.scss index fc1a7c7c8b76b2..e9b34a7f58107e 100644 --- a/packages/block-library/src/gallery/style.scss +++ b/packages/block-library/src/gallery/style.scss @@ -57,6 +57,12 @@ font-size: $default-font-size; background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.7) 0, rgba($color: $black, $alpha: 0.3) 70%, transparent); + // White background variation + .is-style-white-caption-background & { + color: inherit; + background: linear-gradient(0deg, rgba($color: $white, $alpha: 0.7) 0, rgba($color: $white, $alpha: 0.3) 70%, rgba($color: $white, $alpha: 0)); + } + img { display: inline; }