Skip to content

fix(help): accessible colors for help text statuses#240

Merged
varl merged 2 commits intomasterfrom
accessible-help-texts
Mar 5, 2021
Merged

fix(help): accessible colors for help text statuses#240
varl merged 2 commits intomasterfrom
accessible-help-texts

Conversation

@cooper-joe
Copy link
Copy Markdown
Member

This PR changes the color of warning and valid variations of the help component. The previous colors were not AA accessible.

I have replaced theme.valid and theme.warning with the color variables because the theme values are used elsewhere where the contrast requirements are not as strict. I contemplated adding theme.warning-dark and theme.valid-dark, but I thought that was over-engineering this. I am open to feedback if that would indeed be a better solution. Perhaps theme.warning-text might be a useful addition?

@cooper-joe cooper-joe requested a review from a team as a code owner August 14, 2020 10:51
@cypress
Copy link
Copy Markdown

cypress Bot commented Aug 14, 2020



Test summary

502 0 0 0


Run details

Project ui
Status Passed
Commit fd63bc0
Started Mar 5, 2021 3:15 PM
Ended Mar 5, 2021 3:21 PM
Duration 05:15 💡
OS Linux Ubuntu - 20.04
Browser Electron 87

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@ghost
Copy link
Copy Markdown

ghost commented Aug 24, 2020

I have replaced theme.valid and theme.warning with the color variables because the theme values are used elsewhere where the contrast requirements are not as strict.

Would it be harmful if we just update the theme values to the colors with the proper contrast? It might not strictly be necessary everywhere, but if it's not harmful that seems like the easiest solution to me. What do you think @cooper-joe?

@cooper-joe
Copy link
Copy Markdown
Member Author

I have replaced theme.valid and theme.warning with the color variables because the theme values are used elsewhere where the contrast requirements are not as strict.

Would it be harmful if we just update the theme values to the colors with the proper contrast? It might not strictly be necessary everywhere, but if it's not harmful that seems like the easiest solution to me. What do you think @cooper-joe?

This is certainly simpler yes, though I think that this might causes headaches for people using those warning or valid variations in other places - for example as fills or backgrounds. Without knowing all of those use cases I feel like changing the value here would not be good.

I am leaning towards having two theme values: warning and warning-dark or warning-text-accessible. There are still instances where warning is useful. Having a single warning color is not ideal, just like having a single yellow or red wouldn't work. Perhaps this is an argument for a warning900warning050 system?

@ghost
Copy link
Copy Markdown

ghost commented Aug 31, 2020

I have replaced theme.valid and theme.warning with the color variables because the theme values are used elsewhere where the contrast requirements are not as strict.

Would it be harmful if we just update the theme values to the colors with the proper contrast? It might not strictly be necessary everywhere, but if it's not harmful that seems like the easiest solution to me. What do you think @cooper-joe?

This is certainly simpler yes, though I think that this might causes headaches for people using those warning or valid variations in other places - for example as fills or backgrounds. Without knowing all of those use cases I feel like changing the value here would not be good.

I am leaning towards having two theme values: warning and warning-dark or warning-text-accessible. There are still instances where warning is useful. Having a single warning color is not ideal, just like having a single yellow or red wouldn't work. Perhaps this is an argument for a warning900warning050 system?

Yeah tricky. On the one hand ensuring good contrast without the developers having to pay too much attention to it would be nice. On the other hand, it's difficult for us to predict all usecases.

warning900 – warning050 system?

I can see the use of that, but then again, at that point they would just be aliases of yellow900 to yellow050, etc, right? I think I'd be fine with just having the colors (yellow, blue, red, etc.). It's well established what colors we use where, so dropping the warning, error, info colors seems likea good solution to me 👍

@ghost
Copy link
Copy Markdown

ghost commented Aug 31, 2020

Oh wait. I see now that you didn't want to drop them entirely. In that case it does introduce some inconsistencies. Like as a developer, would it be obvious to you why we're using the error color for the error, but the yellow and blue for the other states? Do we add comments everywhere where we're not using the error, warning, info color aliases that this is for contrast? I'm fine with this particular change, but maybe we should think about a nice generic way to approach this elsewhere? Maybe the design repo?

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with these changes 👍. @dhis2/team-apps anyone have any strong feelings against?

@ghost ghost self-requested a review September 29, 2020 10:00
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cooper-joe This is fine to merge I think. Unless there's something that still needs to be done that I'm not aware of?

@varl varl force-pushed the accessible-help-texts branch from a5c551f to fd63bc0 Compare March 5, 2021 15:08
@varl varl enabled auto-merge March 5, 2021 15:08
@varl varl merged commit e6ef1de into master Mar 5, 2021
@varl varl deleted the accessible-help-texts branch March 5, 2021 15:34
@dhis2-bot
Copy link
Copy Markdown
Contributor

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants