You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 EuiFormRowhelpText 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.
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?
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.
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:
.euiTexta:not([class^='eui']), // all links that aren't using EUI at all
.euiTexta.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.euiTexta:not([class^='eui']), // all links that aren't using EUI at all
.euiTexta.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@mixinunderlineNakedLinks() {
&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; }
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.
👋 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.
👋 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.
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.
Activity
myasonik commentedon Mar 31, 2020
@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?
cchaos commentedon Mar 31, 2020
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.myasonik commentedon Mar 31, 2020
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:
If we want to omit more from the
a.euiButtonEmptyselector, 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:Whatever it is we settle on could then be wrapped up in a mixin to be dropped into wherever we need it like:
cchaos commentedon Mar 31, 2020
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).
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
EuiLinkthat should be used for all anchor tags anyway. Let's start there and work up our way to larger encompassing components.myasonik commentedon Mar 31, 2020
Sure — I'm happy to start there! Do you want to table the EuiCallout and EuiFormRow
helpTextanderrortext ideas for now too?cchaos commentedon Mar 31, 2020
I would table EuiCallout since that is rendering an EuiText, but we can attempt the form stuff.
github-actions commentedon Mar 20, 2021
👋 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.
github-actions commentedon Sep 17, 2021
👋 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.
cchaos commentedon Sep 17, 2021
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.