Skip to content
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

Update: Use gradient classes in cover block #18590

Merged
merged 1 commit into from Nov 19, 2019

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 18, 2019

Description

This PR makes cover block use gradient classes. It was not possible to do it from the start because the block needed to be refactored into a functional component.
cc: @youknowriad

How has this been tested?

I added a cover block with a simple gradient background.
I added a cover block with an image and gradient overlay.
I added a video block with an image and gradient overlay.
I published the post with the three blocks and verified it looked as expected. On the code editor, the editor used classes and not inline styles to specify the gradient.

@@ -34,6 +36,8 @@ export default function save( { attributes } ) {
minHeight,
} = attributes;
const overlayColorClass = getColorClassName( 'background-color', overlayColor );
const gradientClass = __experimentalGetGradientClass( gradient );

This comment has been minimized.

Copy link
@youknowriad

youknowriad Nov 19, 2019

Contributor

__experimentalGetGradientClass and getColorClassName

Some naming inconsistencies here :) Also when do you think we should make the "gradients" stable?

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Nov 19, 2019

Author Member

__experimentalGetGradientClass and getColorClassName

Some naming inconsistencies here :)

Hopefully, it is experimental so we can correct the inconsistency.

Also when do you think we should make the "gradients" stable?

I think first we should merge the custom gradient picker, and stabilize its UI.
It seems we may end up with tabs to separate solid colors and gradients as @mtias suggested #17603 (comment).
When we go for that design a gradient hook may not make sense and it may be better to add gradient support in the colors hook (essentially move the hook we have now into useColors) so we can return the tabbed UI there and remove the need for blocks to add it.

This comment has been minimized.

Copy link
@youknowriad

youknowriad Nov 19, 2019

Contributor

agreed about the hooks, but for the theme support, I think we can probably remove the experimental flag from there unless you think the format is subject to change?

Copy link
Contributor

youknowriad left a comment

LGTM 👍

@jorgefilipecosta jorgefilipecosta merged commit 99dd0ee into master Nov 19, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the update/use-gradient-classes-in-cover-block branch Nov 19, 2019
@youknowriad youknowriad added this to the Gutenberg 7.0 milestone Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.