Components: md-input changing un-focus text and under-line color

Created on 1 Oct 2016  路  8Comments  路  Source: angular/components

screen shot 2016-10-01 at 10 41 08 pm
Hi,
Very excited with the progress being made, excellent work and thank you.

I have simple question, is it possible to change md-input text color and line color when it is un-focused? For example I am using md-input on a dark background hence would like a white font and underline.

Most helpful comment

To change label color and underline :
mat-focused .mat-form-field-label{ color: #ee6e73; } .mat-focused .mat-form-field-underline .mat-form-field-ripple{ background: #ee6e73; }

All 8 comments

@bkarv -- the GitHub issue tracker is for project bugs and project feature requests as noted in CONTRIBUTING.md. For better support, consider creating a question on StackOverflow with all the details.

If you look at md-input theme and component scss files you will find out how they implement it. It is easy to customize for your needs.
I think you should look at theming.md file. Theming allow you to customize your components based in a theme.
I've made a PR #1385 that explain a little more about theming custom components. I do not know if it is the better way of doing this but is the way I've found.

Thanks. I tried stackoverflow and no luck as it is quite new. I've tried using css selectors eg #test input:first-child {color:white;} or '#test input{color:white;}' and no luck still sticks to default black. (Note id test is assigned to md-input) Just want to know if it is actually possible therefore I can look at alternative solutions? Assuming the above worked in Angular Material 1 should I put this as a new issue?

To change label color and underline :
mat-focused .mat-form-field-label{ color: #ee6e73; } .mat-focused .mat-form-field-underline .mat-form-field-ripple{ background: #ee6e73; }

To change label color and underline :
.mat-focused .mat-form-field-label{ color: #ee6e73; } .mat-focused .mat-form-field-underline .mat-form-field-ripple{ background: #ee6e73; }

This Works, thaks MarouaneSH

.mat-form-field-appearance-legacy {
.mat-form-field-underline {
height: 0 !important;
}
.mat-form-field-wrapper{
padding-bottom: 0 !important;
}
.mat-form-field-infix{
// padding: 0 !important;
border-top: 0 !important;
}
}

.mat-focused {
.mat-form-field-label
{
color: #78818b !important;
}
.mat-form-field-underline {
.mat-form-field-ripple {
display: none !important;
}
}
}

@JaimeBulaHNP you welcome 馃憣

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xtianus79 picture xtianus79  路  3Comments

RoxKilly picture RoxKilly  路  3Comments

Miiekeee picture Miiekeee  路  3Comments

MurhafSousli picture MurhafSousli  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments