-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLANET-4924 Re-enable the native buttons block #251
Conversation
a13cc94
to
bf2998c
Compare
b29acd0
to
1158f1e
Compare
@@ -570,6 +570,10 @@ public function set_color_palette() { | |||
|
|||
// Disable custom color option. | |||
add_theme_support( 'disable-custom-colors' ); | |||
|
|||
// Disable gradient presets & custom gradients. | |||
add_theme_support( 'editor-gradient-presets', [] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Here I disabled the gradient presets
& custom gradients
globally.
1158f1e
to
84c0179
Compare
476dcfa
to
4e43256
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the link to the gutenberg file you based on to point to the right commit/tag?
assets/src/BlockFilters.js
Outdated
return settings; | ||
} | ||
|
||
if ( settings.name = 'core/button' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be ===
assets/src/p4_button/edit.js
Outdated
@@ -0,0 +1,273 @@ | |||
/** | |||
* This file is copy of core button block edit.js (https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/button/edit.js), with customize changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for including the url here. Could you just have it point to the exact commit that our version is based on. If it points to blob/master this will not match anymore once the file is changed in Gutenberg.
4e43256
to
3a4b98f
Compare
@@ -57,31 +75,6 @@ const applyFallbackStyles = withFallbackStyles( ( node, ownProps ) => { | |||
} ); | |||
|
|||
const NEW_TAB_REL = 'noreferrer noopener'; | |||
const MIN_BORDER_RADIUS_VALUE = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to keep this part in, as we already removed its usage. Keeping it will make it a lot easier to keep this file up to date with whatever changes happen in Gutenberg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Maybe you can re-add the BorderPanel
definition and the constants? Even though they're not used anymore with your changes, it's probably better to keep this file as close to the original as possible to make it easier to keep up to date.
bb5925f
to
216cfd7
Compare
216cfd7
to
edf475f
Compare
The button block is updated in WP-5.4 release with "buttons" block. The new buttons block offers additional options to editors -
Task -
The WP core buttons block,wont have a build in setting to disable the border radius option and update custom text and background color. The issue regarding build in support to control button block is open( Issue #19796 )
The approach I followed here to fix button block is, Override core button block edit method with our requirement. (ref. Issue #19796 comment)
Eg. https://k8s.p4.greenpeace.org/test-titan/test-button-block/
Styleguide PR: greenpeace/planet4-styleguide#47