-
Notifications
You must be signed in to change notification settings - Fork 39
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
Updated buttons to be more accessible. #373
Conversation
* darkened colors * updated inverse disabled butotn * updated colors and read state on links
@dsjen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @andy-armstrong, @clrux and @talbs to be potential reviewers. |
@dsjen This looks great! A couple of minor things I noticed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put a few comments/concerns inline.
@@ -93,7 +93,7 @@ info: Buttons should be used for performing actions within the edX envi | |||
<button type="button" class="btn-inverse">Inverse</button> | |||
<button type="button" class="btn-inverse btn-large">Inverse Large</button> | |||
<button type="button" class="btn-inverse btn-small">Inverse Small</button> | |||
<button type="button" class="btn-inverse" disabled>Inverse Disabled</button> | |||
<button type="button" class="btn" disabled>Base Disabled</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem with replacing the class in this example is that it is still possible to have an inverse button that is disabled and get the old style. Shouldn't we tweak the inverse disabled button styling?
I also think using the base disabled style here sticks out like a sore thumb compared to the other inverse buttons next to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree! The disabled-ness of it draws a lot of attention. @chris-mike -- what do you think? Is there another color combination?
border-color: palette(primary, accent); | ||
background: palette(primary, accent); | ||
border-color: $btn-focus-color; | ||
background: $btn-focus-color; | ||
color: palette(primary, x-back); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this wasn't part of this PR, but do we have a ticket for improving the disabled button text color? It's way too low of a contrast, I'm sure it would trip the accessibility checker.
Edit: Actually, I just looked into this because I was curious how other people handle low-contrast disabled buttons, and the W3C gives an explicit exception for disabled UI elements: http://ux.stackexchange.com/a/80885 So maybe we don't need to change it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it difficult to read too and thank you for bringing that up. @chris-mike -- I'm happy yo change the disabled button text color here (should just be a line) or we can address this in a follow up story if more discovery is needed for a recommendation.
@andy-armstrong -- thanks for bringing attention the hover outline. @chris-mike -- do you have a style in mind to address the odd looking outline in the "elevated" button now that we've darkened the hover color? Also, the inverse disabled button is what was asked for in the ticket, but I agree that it looks very odd...even like an error. @chris-mike -- recommendation on the disabled button with inverse background? |
👍 |
I've made a few changes that @chris-mike suggested:
Please see the screenshot as I'm unable to deploy a sandbox: Outstanding questions:
|
+1 for removing the elevated button, I don't think it's consistent with any of our existing branding/style. |
+1 for removing the elevated buttons from me too. I don't see any usage of them anywhere. @talbs can you give us the history on elevated buttons? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This is such a great, and long overdue, clean up. Thanks @dsjen!
I have some minor comments if you want to address them now, but no worries if you choose not to.
@@ -120,8 +120,8 @@ $btn-small-font-size: font-size(small); | |||
&.is-hovered, | |||
&:focus, | |||
&.is-focused { | |||
border-color: palette(primary, accent); | |||
background: palette(primary, accent); | |||
border-color: $btn-focus-color; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these into variables! We should strive never to use palette
directly in our Sass, but instead use variables. This allows a theme to override the value for the variables and get a consistent experience.
border-color: palette(primary, accent); | ||
background: palette(primary, accent); | ||
border-color: $btn-focus-color; | ||
background: $btn-focus-color; | ||
color: palette(primary, x-back); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd understand if you see this as out of scope, but would you mind making this a variable too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing! Updating this to use $btn-focus-text-color
.
@@ -138,7 +138,7 @@ $btn-small-font-size: font-size(small); | |||
&:disabled, | |||
&.is-disabled { | |||
border-color: palette(grayscale, back); | |||
color: palette(grayscale, back); | |||
color: palette(grayscale, accent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a variable too.
border-color: palette(grayscale, back); | ||
color: palette(grayscale, back); | ||
} | ||
border-color: palette(grayscale, accent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make these use variables.
</div> | ||
|
||
<h3 class="example-set-hd">Links without visual styling</h3> | ||
<p>To indicate 'read' or 'visited' links in content areas, use color Primary Dark.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find myself confused by this. I read this as advice to the user of the Pattern Library, but this isn't something in their control. Maybe you can make it sound less like an option, such as
Note: unread links use the primary color, while read/visited links use primary dark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! FYI, @chris-mike
Added the following variables:
|
Description
FEDX-231
Accessility updates to buttons:
Preview: http://ux-test.edx.org/dsjen/a11y-buttons/components/buttons/
Manual Test Plan
Testing Checklist
Non-testing Checklist
Post-review
Reviewers
I'm looking for two developer 👍 in addition to @chris-mike as product reviewer. If you've been tagged for review, please check your corresponding box once you've given the 👍.
@chris-mike -- Please confirm that this is what you were expecting.