-
Notifications
You must be signed in to change notification settings - Fork 6.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
md-hint add color property #2965
Comments
I have been refactoring hundreds of Bootstrap 4 fields to Material 2, and I appreciate But for validation messages I have been moving |
Good idea. While I was thinking about the A good solution would be having a directive that is responsible for the color classes. Need to discuss first. |
I think it's also good to have a color option on md-hint, but I think its better that you can set a error color in the theme file. Material2 itself should apply the error color on the hint and the md-input-underline. Just like https://material.io/guidelines/patterns/errors.html#errors-user-input-errors For now I'm creating a css file that does that based on the ng-dirty and ng-invalid classes.
should i create a new issue: "add error styling to inputs" ? |
@gvlekke I agree with this being a good idea. Thanks for the css snippet. Helped me style my validation in the manner I required. Spent longer than I care to admit messing around having missed ng-dirty / ng-invalid overrides... For those interested as of 2.4.6 relevant css is:
|
Out of the box styling solution for invalid inputs and error messages would be great. Color property for md-hint would definitely help a lot as everybody now need to write custom css to achieve this common task. Or maybe a separate md-error component. Hopefully this will be considered before final release. That's how I currently style it using theme warn color:
|
I currently don't use any forms, just md-inputs (all inputs are hooked up to immediate updates on blur to the backend), and the first thing I did was try to add a color property to md-hint, so it certainly would feel a natural solution. Alternatively following the standard ng-dirty etc. would be great too of course. |
This isn't something that's in the Material Design spec and we already have mat-error for showing error color messages. I don't think its a feature we'll add, though it should be easy enough for users to add by using CSS and Angular Material's theming system (see https://material.angular.io/guide/theming-your-components) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This is a feature. It would be really nice to use the color property like on
md-button
to determine which hints are warnings, accents or primary etc... I'm using the hints for both showing validation errors and anything related to the users input.The text was updated successfully, but these errors were encountered: