Calcite-components: Custom :focus styles

Created on 22 May 2019  ·  13Comments  ·  Source: Esri/calcite-components

Are there any plans or patterns to do custom :focus states?
We sometimes see weird stuff with browser default focus outline.

Of course, we would want to retain accessibility.

I know there's stuff like outliner.js and stuff like that.

cc @driskull @jcfranco

a11yproject.com article

design enhancement question

Most helpful comment

Focus States Light Simple
Examples Light
Examples Dark

@asangma @julio8a @paulcpederson @macandcheese

Here is the latest update based on a few meetings and talks with folks. See the Rules png pasted here.

  • It is a basic cascading rule set using increments of 2px.
  • Light theme/dark theme.
  • Rounded corners when applicable
  • Simple transitions
  • See this link for a super quick demo https://codepen.io/bslayer/pen/qBEMgQw

Next steps will be getting a more high fidelity demo, and then testing.

After that, Ideally we will test 2 designs. A) Being the styles shown here and B) being an even more super noticeable color way (black and white instead of blue)

All 13 comments

Yeah, @macandcheese and I talked about this a bit. Because these styles are scoped to the component, it is totally possible to define custom styles for each component. Probably a shared variable or mixin would be the best like @include focus-outline()

(╭ರᴥ•́)
I like it.
I'm guessing a buncha designs would help this along.

cc @oknoway

@bstifle do you have a set of designs for focus states library-wide? If we can get away with a single custom focus style everywhere that would be better, but we could also do one-off focus styles for every element as long as they're visually cohesive.

cc @asangma and Mitch as well re: our conversation yesterday

Just to note, there is an open issue related to this in the arcgis-components Share dialog.

@asangma did you all have any thoughts here?

Focus States Light Simple
Examples Light
Examples Dark

@asangma @julio8a @paulcpederson @macandcheese

Here is the latest update based on a few meetings and talks with folks. See the Rules png pasted here.

  • It is a basic cascading rule set using increments of 2px.
  • Light theme/dark theme.
  • Rounded corners when applicable
  • Simple transitions
  • See this link for a super quick demo https://codepen.io/bslayer/pen/qBEMgQw

Next steps will be getting a more high fidelity demo, and then testing.

After that, Ideally we will test 2 designs. A) Being the styles shown here and B) being an even more super noticeable color way (black and white instead of blue)

There's 3 main things we are trying to solve with this design, weighted by importance:

  1. Consistency across Esri properties and components
  2. Noticeable, meaningful, and WCAG-able—While not being overly clunky and distracting.
  3. Scalability and ease of use for current and future designs

Looks good!

Nice!
slicer

moving this convo over at calcite-base https://github.com/Esri/calcite-base/issues/19

Was this page helpful?
0 / 5 - 0 ratings