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

Text mode: title and content textarea focus style #1837

Closed
afercia opened this issue Jul 10, 2017 · 9 comments
Closed

Text mode: title and content textarea focus style #1837

afercia opened this issue Jul 10, 2017 · 9 comments
Labels
[Feature] Code Editor Handling the code view of the editing experience [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time

Comments

@afercia
Copy link
Contributor

afercia commented Jul 10, 2017

In text mode, the title and content textarea elements should have a better focus style. Since text mode is supposed to be the most accessible one, and for some users will be the only mode that empowers them to enter content without barriers, I'm not sure the current behavior of the focus style is ideal.

when focus is on the title and the title is empty, the component gets an is-selected CSS class that applies a light gray outline #e2e4e7 to the h1 wrapping the textarea:

screen shot 2017-07-10 at 15 44 00

#e2e4e7 doesn't have a sufficient color contrast with the background and when users start typing, the focus style disappears completely:

screen shot 2017-07-10 at 15 44 05

The content textarea has no focus style at all:

screen shot 2017-07-10 at 15 53 46

screen shot 2017-07-10 at 15 45 30

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Feature] Code Editor Handling the code view of the editing experience labels Jul 10, 2017
@afercia
Copy link
Contributor Author

afercia commented Jul 10, 2017

Worth noting the post title is shared by visual and text mode. There are classes to target visual/text modes though.

Also, adding a focus style for the text mode content area would probably require to review a bit the textarea size/paddings. See in the screenshot below, where the red outline is just to highlight the current elements size:

screen shot 2017-07-10 at 16 12 50

@afercia
Copy link
Contributor Author

afercia commented Jul 10, 2017

Not sure why the transition property is set also on the state changes, as far as I know it should be set only on the initial state, see

h1 {
outline: 1px solid transparent;
margin: 0;
padding: #{ $block-padding / 2 } #{ $block-padding - 2px };
font-size: $editor-font-size;
transition: 0.2s outline;
}
&:hover h1 {
outline: 1px solid $light-gray-500;
transition: 0.2s outline;
}
&.is-selected h1 {
outline: 2px solid $light-gray-500;
transition: 0.2s outline;
}

/cc @mtias

@abdul
Copy link

abdul commented Jul 10, 2017

@afercia:

  1. What do you recommend for focus style on title/content in text-mode? I think, a thinner outline (like on on hover state) will do fine?
  2. I think that's mistake "transition" property being set on state changes.

Thank you

@afercia
Copy link
Contributor Author

afercia commented Jul 10, 2017

@abdul as long as it's a shape with a sufficient color contrast ratio with the background, it's ok for accessibility. As per the design part, I'll leave that decision to the team leads. /cc @jasmussen @mtias

@abdul
Copy link

abdul commented Jul 11, 2017

@afercia Can you please review my PR?

@afercia
Copy link
Contributor Author

afercia commented Jul 11, 2017

@abdul as I said above, this needs design feedback from the design team before moving on 🙂

@abdul
Copy link

abdul commented Jul 11, 2017

@afercia Please don't mind my restlessness. I will wait for feedback.

Thank you

@afercia afercia changed the title Text mode: title and content textares focus style Text mode: title and content textarea focus style Dec 8, 2017
@aduth
Copy link
Member

aduth commented Mar 10, 2018

Is this closed by #4803 ? cc @jasmussen

@jasmussen
Copy link
Contributor

I would suggest yes. Closing, we can always reopen if there are edgecases that haven't been addressed.

Tug pushed a commit that referenced this issue Feb 28, 2020
* Add ref to gutenberg

* Update ref after adding disableScrollViewPanResponder

* Update ref after adjusting height

* Update ref to point to gutenberg master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Code Editor Handling the code view of the editing experience [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants