Skip to content

md-input changing un-focus text and under-line color #1394

Closed

Description

@bkarv

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.

Activity

  1. JanStureNielsen commented on Oct 1, 2016

    @JanStureNielsen
    Contributor

    @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.

  2. vinagreti commented on Oct 1, 2016

    @vinagreti
    Contributor

    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.

  3. bkarv commented on Oct 2, 2016

    @bkarv
    Author

    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?

  4. MarouaneSH commented on Apr 9, 2018

    @MarouaneSH

    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; }

  5. JaimeBulaHNP commented on Nov 28, 2018

    @JaimeBulaHNP

    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

  6. ashaikh-wal commented on Mar 28, 2019

    @ashaikh-wal

    .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;
    }
    }
    }

  7. MarouaneSH commented on Mar 28, 2019

    @MarouaneSH

    @JaimeBulaHNP you welcome 👌

  8. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions