-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Restore Post Title visual styles in Code View mode #56582
Conversation
Size Change: +55 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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.
Thank you for submitting PR! I have two suggestions in terms of design and accessibility.
Regarding the design, the title area seems to have the thicker border than the content area. Also, the focus outline seems thin.
Regarding accessibility, the title element has been changed from h1
to the textarea
. I tested it with a screen reader (NVDA) and it reads the placeholder "Add title", but I'm concerned that the semantics of the document have been lost.
font-size: inherit; | ||
line-height: inherit; | ||
// Raw Text Variant | ||
.edit-post-text-editor__body .editor-post-title.is-raw-text { |
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.
What does the .is-raw-text
class exist for? Even without this class, it seems that we can determine that it is a code editor just by looking at the .edit-post-text-editor__body
class.
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.
Without this class there is no way to determine whether the field is in "rich" or "raw" mode. I prefer not to rely on a cascade of CSS classes in parents that may or not be present in other contexts.
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.
I see, I understand 👍
The semantics issue needs a fix asap. |
Excellent spots! Thank you. I've adjusted them a bit. It's tricky because the HTML structure is not the same (depends on #56633) but I think I've now managed to reuse more of the original styles which should avoid things looking inconsistent. |
71a6e89
to
9eac8b0
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.
LGTM!
- The title in the code editor has the same default border and focus style as the content.
- Visual mode is not affected by this style.
Regarding title semantics, let's consider whether or not we need to address in #56633.
* Apply styles to match previous visuals * Adjust CSS in response to feedback
What?
Restores the visual styles to the Post Title field that were lost as part of #54718
Closes #56581
Why?
We should retain the previous visual styles.
How?
These styles were lost due to the usage of a new component. Update the post title styles for the "raw" variant to match the previous design.
Testing Instructions
Reference screenshot
This is how the field looked on
trunk
prior to the merge of #54718.Testing Instructions for Keyboard
Screenshots or screencast
Before (current trunk)
After (this PR)
The following screenshot is how the field looks as a result of this PR: