Skip to content

Adding underlines to some links/buttons #3202

Closed

Description

@myasonik

In an effort to iteratively improve accessibility for our links/buttons (#2446) let's add underlines to some links in specific areas:

  • Inside of EuiCallout
    • Why? Because callouts can be so many different colors, it's a nightmare for calculating all of the color contrast possibilities. Doing this let's us cut a bunch of permutations.
  • Inside of EuiText
    • Why? Mostly because it makes some logical sense. We expect this content to be longer form text content so let's optimize for scanning and reading.
  • Inside of EuiFormRow helpText and error text
    • Why? It's small text with less contrast which compounds how difficult it is to see something actionable.

Term definition

  • Link: In this issue, I refer to "links" a lot. For the purpose of this issue, a link is anything inside of an anchor tag (<a>) that doesn't have any visual affordances other than color. In EUI, this means EuiLink and EuiButtonEmpty with an href set.

Activity

  1. myasonik commented on Mar 31, 2020

    @myasonik
    ContributorAuthor

    @cchaos @snide What do y'all think of these 3 areas?

    Also, I left off mentioning EuiButtonEmpty at all to kick the can down the road a little till we see how this shakes out. Is that cool or do you think we should address them together?

  2. cchaos commented on Mar 31, 2020

    @cchaos
    Contributor

    Here is part of a problem with EuiText as @snide was getting at. People wrap all kinds of things in EuiText if there's also any plain text somewhere inside. If we blanket say .euiText a { text-decoration: underline } then if they put buttons inside there, they will start getting underlines too. It's just a bit too tricky right now without having to do a bunch of :not() syntax.

    Screen Shot on 2020-03-31 at 13:08:34

  3. myasonik commented on Mar 31, 2020

    @myasonik
    ContributorAuthor

    I guess my thought on this is that this is fine... When we make this change the first time, we'll have to hunt a little for these kind of issues and we can help teams migrate away from abusing EuiText. In the future, devs will have more visual clues that maybe they're not doing something they should be or will "pay the cost" of having links underlined.

    Like, the "breakage" here, isn't that bad imo.


    For the technical aspect of how to implement this, I think we can come up with a manageable selector. What about something like:

    .euiText a:not([class^='eui']), // all links that aren't using EUI at all
    .euiText a.euiButtonEmpty { ... } // links that have no visual affordances other than color

    If we want to omit more from the a.euiButtonEmpty selector, we could also add a class for when an icon is passed in (there is a class added already for when an icon is on the right, but not for when the icon is on the left). This adds a bit more :not()-complexity but, I think, is still reasonable. That could look something like:

    // THIS IS HYPOTHETICAL, WILL NOT WORK TODAY
    .euiText a:not([class^='eui']), // all links that aren't using EUI at all
    .euiText a.euiButtonEmpty:not([class*='icon']) { ... } // links that have no visual affordances other than color

    Whatever it is we settle on could then be wrapped up in a mixin to be dropped into wherever we need it like:

    // mixin-example.scss
    @mixin underlineNakedLinks() {
    	& a:not([class^='eui']), // all links that aren't using EUI at all
    	& a.euiButtonEmpty { ... } // links that have no visual affordances other than color
    }
    
    // euiText.scss
    .euiText { @include underlineNakedLinks; }
    
    // euiCallout.scss, etc.
    .euiCallout { @include underlineNakedLinks; }
    
  4. cchaos commented on Mar 31, 2020

    @cchaos
    Contributor

    I guess my thought on this is that this is fine... When we make this change the first time, we'll have to hunt a little for these kind of issues and we can help teams migrate away from abusing EuiText.

    I disagree here. I think a) You give too much credit to the consumers thinking that the render is not as intended and b) the regression on button's isn't acceptable because it's too close to our focus state (which uses underline).

    .euiText a:not([class^='eui']), // all links that aren't using EUI at all

    This gets too slippery and can be hard to maintain, coming from the knowledge of these universal non-eui selectors we already have in Kibana.


    Here's an alternative, let's not blanket target anything in EuiText. Instead, we do have a specific link component EuiLink that should be used for all anchor tags anyway. Let's start there and work up our way to larger encompassing components.

  5. myasonik commented on Mar 31, 2020

    @myasonik
    ContributorAuthor

    Here's an alternative... we do have a specific link component EuiLink... Let's start there...

    Sure — I'm happy to start there! Do you want to table the EuiCallout and EuiFormRow helpText and error text ideas for now too?

  6. cchaos commented on Mar 31, 2020

    @cchaos
    Contributor

    I would table EuiCallout since that is rendering an EuiText, but we can attempt the form stuff.

  7. added
    design decision
    on Sep 20, 2020
  8. github-actions commented on Mar 20, 2021

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  9. added
    stale-issue
    on Mar 20, 2021
  10. removed
    stale-issue
    on Mar 20, 2021
  11. github-actions commented on Sep 17, 2021

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  12. added
    stale-issue
    on Sep 17, 2021
  13. cchaos commented on Sep 17, 2021

    @cchaos
    Contributor

    In ##4979 we increased the weight of links when compared to normal text. This isn't 100% what this ticket was implying, but it's certainly a marked improvement for contrasting links against text. The underline portion is difficult and would need some sort of context awareness that we don't have. Gonna close for now and see if it props up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilitydesign decisionstale-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions