-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Mailchimp Block: UI Review Updates #30685
Conversation
…moval of some unnecessary classes on the frontend, and changes to the view script to reflect these removals. Some style definitions moved from view stylesheet to editor's since they aren't used on frontend.
It looks great, thank you @jeffersonrabb! I just have a couple of notes/remarks:
Core Button's background color is good 👍 I'm just wondering now if we should allow for background/text custom colors like the actual Button block: https://cloudup.com/coHwOau93wT Also, we shouldn't have a "link" option for the button and italic/bold doesn't seem to work, I think it's safe to remove these: https://cloudup.com/czHUFkuNB1N
Rather than forcing the color, font-size and font-style, can we just have a |
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.
A quick comment, I'll have another look when design feedback is addressed.
<TextControl placeholder={ emailPlaceholder } onChange={ () => false } /> | ||
<Button isPrimary>{ submitLabel }</Button> | ||
<TextControl placeholder={ emailPlaceholder } onChange={ () => false } type="email" /> | ||
<div className="wp-block-button__link wp-block-jetpack-mailchimp_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.
Was it impossible to use the Button
component here? I'd very much prefer to rely on that component rather than a class it uses.
If we need the styling, I think we're better off pulling the necessary styles into our own CSS.
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.
The goal was to emulate the Gutenberg button block in appearance and functionality - and since https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/button/edit.js doesn't make use of the Button
component I fear that this would lead to slight style divergences and then CSS to overcome them. Re: the styling, yes I'll pull it in.
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.
If we need the styling, I think we're better off pulling the necessary styles into our own CSS.
This is done in 8f066fd
Removed all the formatting controls in bc6db32 |
Confirming, the suggestion is to replace the |
…onsistency with Core Button block without relying on a class from that block (wp-block-button__link).
I like the idea, but fear this puts us on a slippery slope of chasing the core button block. If we allow color customization would we also need to support core Button's style choices (Rounded|Outline|Squared)? Button has what looks like fairly dense color fallback handling, and uses a component called Given all of this, if you still feel we ought to pursue color options for the button I'd propose we land the current PR and address in a new one. @thomasguillot what do you think? |
|
Fair enough, thank you for the explanation @jeffersonrabb. Let's keep it as is 😊 |
I'm not sure this structure is possible - we're using the
tagName attribute to small , the output looks pretty good but there's no paragraph tag. Is this invalid HTML? Also note this applies only to the editor. In the front-end we can structure the output however we'd like.
|
Can't you do the following? <p><RichText tagName="small" /><p> |
@thomasguillot is this acceptable markup? |
It's not 😞 |
😞 I actually came across similar problem when I tried to use it recently. I wonder if it could be improved to help with cases like this. There do seem to be short-term plans to iterate on the component: WordPress/gutenberg#13778 |
So much 😞around this one! Changes made in d59edb6 and Automattic/jetpack@f4a7d65. I left the color and italics declarations in but removed the sizing - is this correct? |
Can we just remove the entire CSS for
|
Done in 1bc9f82 and Automattic/jetpack@6961def#diff-e800fe1ba24cea2c2da6f6ac9f542d4dR68 |
Try pulling the Jetpack branch (if you're testing locally), or create a new JN instance. Just resolved the issue in Automattic/jetpack@89d53f0. |
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.
LGTM
…line toolbar, to allow selection of the submit button after consent text editing has taken place. Use appropriate cursor for button text hover and editing.
@artpi pointed out an issue in which the consent text's inline toolbar blocks clicks on the submit button, making the button non-editable. This is fixed along with a change to the button text's cursor in 4518d4e. @thomasguillot does this approach raise any red flags? |
Nope, all good 🙂 |
Changes proposed in this Pull Request
This PR contains a series of UI and design improvements flagged by @thomasguillot and @scruffian in #30667. Since the block uses Server-Side Rendering, many of these fixes involve similar changes in the Jetpack repo. Here's the list of changes. Quoted text is from the issue.
Editor UI:
Done in 141d9f2 and Automattic/jetpack@9431ca9
Done in e363a8c and Automattic/jetpack@d921ac3
Done in da91702.
Notes/Questions:
wp-block-button__link
) to get some of the style without duplicating a bunch of CSS. This might be a questionable practice since future changes Core Button could affect Mailchimp in unexpected ways. Curious if there are opinions on the best way to handle this situation.#0073aa
, which is not one of the Muriel blues. It seemed preferable to replicate the Core style rather than stick to Muriel colors and create dissonance, but I'm happy to go either way on this.components-button is-button is-primary
, which should leave the button style to the theme.Done in 7f61c70 and Automattic/jetpack@f801919. I applied a few additional styles here:
wp-calypso/client/gutenberg/extensions/mailchimp/view.scss
Lines 32 to 35 in 7f61c70
Done in caaf827 and Automattic/jetpack@1a0be76.
Note: In the WP.com sharing interface, there are still instances of
MailChimp
that should be changed. @artpi would you be willing to take care of these when you have a chance?Front-end:
Done in 49e51ba and Automattic/jetpack@5dba739
Done in 4653bca.
Note: This is tough to test now that the input field is type
email
, since the browser automatically enforces validation. Also, in the Inspector I tried adding the genericerror
class to the input, and didn't see any visual change.For the Editor, this is done in c8d0bf7.
Note: For the Frontend, it isn't terribly straightforward. The approach would probably be to store the notification text bits as data attributes on the block element, and then rework
view.js
to put the appropriate text in the DIV. I'd be happy to do this, but it feels like swapping one form of awkwardness for another, so I'm not sure there's much of a win here. If people feel that this should be done, I'll take it on in a separate PR.For all the color-related changes, it wasn't entirely clear to me where the discussion in the issue landed. Muriel? Gutenberg? For now, I just used @thomasguillot's original colors as-is. If the consensus was to go a different way, let me know and I'll change.
Done in d1e4518
Done in d1e4518
Done in d1e4518
Done in 38e9cd2
Done in ce80348
Testing instructions
JETPACK_BETA_BLOCKS
inSettings->Jetpack Constants
Fixes #30667