Skip to content
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

Consistent defaults for text-input error colors #4066

Closed
jestelle opened this issue Feb 2, 2016 · 4 comments
Closed

Consistent defaults for text-input error colors #4066

jestelle opened this issue Feb 2, 2016 · 4 comments

Comments

@jestelle
Copy link
Collaborator

jestelle commented Feb 2, 2016

It appears in that #de3226 is used as the default 'invalid' color, used to style text indicating an input is invalid.

I'm assuming this was chosen because it meets accessibility contrast guidelines. However, the Material team has new recommendations on defaults here.

The Material Design team recommends replacing the default with:
Google Red a700 (#D50000) on light backgrounds and

ff6e6e on dark backgrounds.

FF6E6E is a value outside of the Material palette but its the closest to Red A700 that passes accessibility.

These colors will match the Material spec, but shouldn't be considered cast in stone.

For that reason, keeping your defaults is totally reasonable, although you may want to think about what you do for dark backgrounds. Also, we are attempting to bring consistency across all Material platforms for the default here, so you can see similar bugs:
PolymerElements/paper-input#326
angular/material#6982

Developers and designers are welcome to override these defaults, but should take care in meeting accessibility requirements within their own applications.

@sgomes
Copy link
Contributor

sgomes commented Feb 3, 2016

Thanks, @jestelle! We'll update to red a700 here.

As for dark backgrounds, we haven't done any specific work so far. That would be the "dark theme" in the spec, I assume?

@sgomes sgomes closed this as completed in 736b2d3 Feb 3, 2016
@sgomes
Copy link
Contributor

sgomes commented Feb 3, 2016

Revived #328 to track dark theme implementation in V2.

@Gomah
Copy link

Gomah commented Feb 3, 2016

I also noticed an "untouched" class for inputs who requires validation in Angular Material.

Following the text fields component, the error is toggled once the field is not untouched (on blur/focusout).

It's possible to hack it but it's a bit dodgy: https://jsfiddle.net/1nz8jymv/ ; Would be nice to have this standard implemented 😄

@Garbee
Copy link
Collaborator

Garbee commented Feb 4, 2016

@Gomah This has been brought up numerous times before. We use native validation APIs which don't currently allow for that behavior. And doing deeper dirty-state checking ourselves is a lot of extra effort to maintain.

Yes we diverge from the spec a bit, but it is the native way to do things.

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

No branches or pull requests

4 participants