-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Buttons color Error #74
Comments
Wouldn't this be the correct behavior as your focus is still on the button since the button doesn't do anything? |
The button has a click function that ends and the button remains the same color, is that okay? |
It's because of how the styling is applied. It's changing the color on |
This is just because the hover and focus states use the same styles. For accessibility we should tweak the focus state to be different from the hover and normal state. Ultimately what's happening is the inset style is from the active state, which happens when you click in. However, just like when you tab through the buttons with the keyboard, your focus is now on that button from the click and since focus and hover use the same styles - it just style looks the same. We shouldn't remove focus but it's worth giving it it's own style. |
+1 for thinking of tab focus, I'd forgotten about that. In that case I think it might be best to keep the hover and focus styling the same for consistency right? |
At a minimum, they should be the same just so focus is set. I think we should come up with a new focus state, maybe remove the hover styles and add a decent outline. I'll do a pull request for some accessibility tweaks. |
I've tried reproducing this on safari and chrome(both OSX) but couldn't reproduce it. |
I get it in Chrome on OS X, it's just the focus styles. https://github.com/nostalgic-css/NES.css/blob/master/scss/elements/buttons.scss#L6 should ideally be split up so focus has it's own unique styles different than the hover style. |
I can confirm that this happens in Chrome 70 on OSX and Chrome 70, FF 63 and Edge on Windows. However for some reason it does not seem like Safari and FF 63 keep focus state when you stop hovering on OSX so this problem does not exist there. |
I see. |
So what would be better, remove the effect in focus, or add a different focus effect? Since they are the same. |
I agree 👍 I splitted the focus and hover styles. ✂️ // buttons.scss
@mixin btn-style($color, $background, $hover-background, $shadow) {
//...
&:focus {
box-shadow: 0 0 0 6px rgba($shadow, 0.3);
}
//...
} |
I think the shadow of the focus looks a little weird, but it's great that now the styles are splitted. 👍 |
a simple and great solution |
🎉 This issue has been resolved in version 2.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The color of the buttons stays the same when you click it then you need to click other place to restore the original button color.
It's a little hard to explain.
The text was updated successfully, but these errors were encountered: