This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Featured Category block: add support for global style (#5542)
* Product title: add support global style #4965 * add specific type * add custom save function * move hooks in a specific folder * fix crash on WP 5.8 * Featured Category block: Add support for global style #4965 Featured Category block: Add support for global style * fix border color * fix opacity * fix border radius * fix order rules css
- Loading branch information
Showing
8 changed files
with
210 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Block from './block'; | ||
|
||
export const Edit = ( props: unknown ): JSX.Element => { | ||
const blockProps = useBlockProps(); | ||
|
||
// The useBlockProps function returns the style with the `color`. | ||
// We need to remove it to avoid the block to be styled with the color. | ||
const { color, ...styles } = blockProps.style; | ||
|
||
return ( | ||
<div { ...blockProps } style={ styles }> | ||
<Block { ...props } /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.wc-block-featured-category { | ||
background-color: inherit; | ||
|
||
.components-resizable-box__handle { | ||
z-index: 10; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.