From 38bf9c2184651b78d02e7bd4d3f3155b8e6366a1 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Mon, 2 Sep 2024 11:07:10 -0400 Subject: [PATCH] Notice block: Add "success" display type --- mu-plugins/blocks/notice/postcss/style.pcss | 6 +++++- mu-plugins/blocks/notice/src/block.json | 2 +- mu-plugins/blocks/notice/src/edit.js | 1 + mu-plugins/blocks/notice/src/icon/library/success.svg | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 mu-plugins/blocks/notice/src/icon/library/success.svg diff --git a/mu-plugins/blocks/notice/postcss/style.pcss b/mu-plugins/blocks/notice/postcss/style.pcss index 9fadffe14..77bc89f65 100644 --- a/mu-plugins/blocks/notice/postcss/style.pcss +++ b/mu-plugins/blocks/notice/postcss/style.pcss @@ -21,6 +21,7 @@ color: var(--wp--custom--wporg-notice--color--text); background-color: var(--wp--custom--wporg-notice--color--background); border-radius: 2px; + font-size: var(--wp--preset--font-size--small); & > * { align-self: start; @@ -59,6 +60,10 @@ margin-top: 1px; } +.is-success-notice .wp-block-wporg-notice__icon { + background-image: url(../src/icon/library/success.svg); +} + .is-info-notice .wp-block-wporg-notice__icon { background-image: url(../src/icon/library/info.svg); } @@ -73,5 +78,4 @@ .wp-block-wporg-notice__content { align-self: center; - font-size: var(--wp--preset--font-size--small); } diff --git a/mu-plugins/blocks/notice/src/block.json b/mu-plugins/blocks/notice/src/block.json index f95f35bc9..4af93553f 100644 --- a/mu-plugins/blocks/notice/src/block.json +++ b/mu-plugins/blocks/notice/src/block.json @@ -29,7 +29,7 @@ "type": { "type": "string", "default": "tip", - "enum": [ "alert", "info", "warning", "tip" ] + "enum": [ "alert", "info", "warning", "tip", "success" ] } }, "example": { diff --git a/mu-plugins/blocks/notice/src/edit.js b/mu-plugins/blocks/notice/src/edit.js index b6f01469e..39077874c 100644 --- a/mu-plugins/blocks/notice/src/edit.js +++ b/mu-plugins/blocks/notice/src/edit.js @@ -12,6 +12,7 @@ import Icon from './icon'; export const typeOptions = [ { label: __( 'Tip', 'wporg' ), value: 'tip' }, + { label: __( 'Success', 'wporg' ), value: 'success' }, { label: __( 'Information', 'wporg' ), value: 'info' }, { label: __( 'Alert', 'wporg' ), value: 'alert' }, { label: __( 'Warning', 'wporg' ), value: 'warning' }, diff --git a/mu-plugins/blocks/notice/src/icon/library/success.svg b/mu-plugins/blocks/notice/src/icon/library/success.svg new file mode 100644 index 000000000..cbed942ba --- /dev/null +++ b/mu-plugins/blocks/notice/src/icon/library/success.svg @@ -0,0 +1 @@ +