-
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
Add border to block "Edit as HTML" style. #25539
Conversation
For a related accessibility discussion about bringing back borders to selected blocks in visual mode (the removal of which is being considered a regression compared to WP 5.4), see #23892. |
Size Change: +6 B (0%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
8d719f6
to
fca7f41
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.
changes look good, I might even add a padding and try to match the design of the "code editor" as much as possible.
let's see what our designers say about it.
Agreed, if possible I'd add some padding. |
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.
Thanks! Nice a11y improvement.
The suggestion to add some padding if possible makes sense to me.
fca7f41
to
9a02311
Compare
Thank you for fixing this. I'm wondering why it has |
@joyously Both of the styles you mentioned existed prior to this PR, so changing them is out-of-scope for this PR. I looked into it, though. They both originate from #2797, when the "Edit as HTML" feature was introduced. No reason is given for the As for what the block looks like next to a floated element... (Note that Twenty Twenty applies negative margins to floated elements, but the end result would be similar even if it didn't.) I mean, it's certainly usable. After some playing around with the CSS, I couldn't come up with a better behavior than this. Feel free to open a separate issue discussing how to improve this, though. |
Yes, I understand. Thanks for checking with this PR (I don't have a dev setup for GB). |
This looks good to me and an overall improvement 👍 |
Description
Adds visible borders to blocks in "Edit as HTML" mode.
According to WCAG 2.1, text input fields ought to have a sufficient level of contrast with their surrounding background. And while Twenty Twenty uses a tan background that does contrast with the white textarea, this is far from the norm. Most themes use white backgrounds, so in those cases the field would blend in with the background. That's not good, especially in this particular case where the field isn't even trying to be WYSIWYG. It doesn't even indicate focus properly.
Additionally, most non-WYSIWYG text inputs in our UI have a certain look to them, which this field lacks in
master
.This PR solves both issues by giving this text field the same look as other standard text inputs across the editor UI.
Screenshots
Before
Unselected
Selected
After
Unselected
Update: I've added some padding.
Selected
Update: I've added some padding.
Checklist: