Skip to content

Commit

Permalink
Notice block: Add "success" display type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Sep 2, 2024
1 parent 7a999b5 commit 38bf9c2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mu-plugins/blocks/notice/postcss/style.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -73,5 +78,4 @@

.wp-block-wporg-notice__content {
align-self: center;
font-size: var(--wp--preset--font-size--small);
}
2 changes: 1 addition & 1 deletion mu-plugins/blocks/notice/src/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"type": {
"type": "string",
"default": "tip",
"enum": [ "alert", "info", "warning", "tip" ]
"enum": [ "alert", "info", "warning", "tip", "success" ]
}
},
"example": {
Expand Down
1 change: 1 addition & 0 deletions mu-plugins/blocks/notice/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
1 change: 1 addition & 0 deletions mu-plugins/blocks/notice/src/icon/library/success.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 38bf9c2

Please sign in to comment.