-
Notifications
You must be signed in to change notification settings - Fork 4.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
Enhancing Quote block styling for different text alignments #13248
Conversation
THANK YOU for sticking with this! This seems overall like a very solid pull request, I'm sure we'll get this in relatively quickly. 🏅 This seems to be working on the frontend, but I'm not seeing any changes in the editor. Have you tried a theme that does not provide editor styles and relies on the default vanilla editor stylesheet? I'm not sure why the theme.scss files aren't being picked up. @gziolo any idea? Styling using this selector, For example for RTL languages, we want to make sure that explicitly set alignments are not autoreversed by PostCSS. For example here's what we have for floats:
The Which brings us to the next thing we need to sanity check and be sure of. The blockquote comes with left alignment by default, which is later overrwritten ( In other words, I think what we need to do here is to:
Nice work! ✨ |
Yeah, I remember running into that recently, too. As far as I know, that's the only way to style these sorts of text alignments within the editor right now — Gutenberg don't provide a special class to hook into for alignment. As for other notes, I'm in agreement with Joen: This seems solid as long as we can make sure it's working great in the editor (not working for me there either yet), for RTL. It's worth highlighting again that this may be a small breaking change for some themes. For instance, Twenty Nineteen will need a patch to make sure people don't end up with double borders as noted above. |
That's a good point. Is there any way we can achieve the same effect, without having to break things here? |
I'm not sure there is — Twenty Nineteen specifically defines that left border. I'm not sure if other themes will do the same (but I imagine they might?). It would be a fairly simple fix in the theme, but a fix would be needed. |
Just wanted to drop a status: I’m off on vacation this entire week. I’ll be back next week and will see if I can schedule this in. I’ll drop another update early next week (Jan. 28). Thanks! |
No stress, and thanks for your work! |
@jasmussen I see some of the styles used in the editor but overridden: I don't see styles which use the following selectors:
|
Indeed, good catch. It seems the editor style needs looser specificity, if possible, to let the theme style more easily override. |
Looks like it is taking me a bit longer to circle back on this. I'm hoping in next week or two to get an update on the Pull Request. Thanks for all the testing and feedback! |
Great idea!! The reason it's not working is because attribute selectors are kinda funny. The space between You'll probably also need a general Try this: |
Thanks so much for sticking this one though, @colorful-tones! It's great to see this implemented. 👏 |
* adjust borders for Quote block text-align * update attribute selector [style*=“text-align: right”] * add [style*="text-align:right"] styling for Quote * add asterisk to [style*=“text-align:center”] * add [style*="text-align: center"] override as well
* adjust borders for Quote block text-align * update attribute selector [style*=“text-align: right”] * add [style*="text-align:right"] styling for Quote * add asterisk to [style*=“text-align:center”] * add [style*="text-align: center"] override as well
Fixes #11609
Description
These changes are CSS only, and in the Quote block's
theme.scss
, which is loaded in both the editor and on the front end if theme has opted in to using them. See Gutenberg Handbook: Theme Support.The CSS affects and/or adds a border to either the left or right depending on the
text-align
chosen in the editor. Border ontext-align: center
are removed.How has this been tested?
Changes were tested in local Docker WP environment with Gutenberg post with all variations of Quote block added. Changes were tested against the TwentyFifteen, TwentySixteen, TwentySeventeen and TwentyNineteen themes.
Tested in Chrome 71.0.3578.98 on macOS 10.14.1.
Screenshots
Types of changes
text-align: right
. However, this does have some impact on existing editor and/or theme styles for some TwentySomething themes:editor-blocks.css
(Gutenberg editor styles) may need to be updated (see screenshot above). The front end output is fine for TwentyFifteen and TwentySixteen.border-left: 2px solid #0073aa
Checklist: