Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the default color of materialize.css input fields. I have attached screenshot

Tags:

materialize

Please see attachment

I have tried to add custom css, but not worked. I need to change the color of text after selecting the input fields.

<div class="input-field form-group">
    <input id="first_name" class="active validate form-control" name="first_name" type="text" value="">
    <label for="first_name" class="mat-label">First Name</label>
</div>
like image 824
Dipayan Das Avatar asked Jul 06 '17 07:07

Dipayan Das


2 Answers

This green is actually $secondary-color

So in SASS, here is how it can be changed:

$secondary-color: #FEBD09;

@import "materialize-css/sass/components/variables";
like image 179
Pierre de LESPINAY Avatar answered Sep 21 '22 11:09

Pierre de LESPINAY


For the line color, I was able to change the default green to black with the css below.

input:not([type]):focus:not([readonly]), input[type="text"]:not(.browser-default):focus:not([readonly]), input[type="password"]:not(.browser-default):focus:not([readonly]), input[type="email"]:not(.browser-default):focus:not([readonly]), input[type="url"]:not(.browser-default):focus:not([readonly]), input[type="time"]:not(.browser-default):focus:not([readonly]), input[type="date"]:not(.browser-default):focus:not([readonly]), input[type="datetime"]:not(.browser-default):focus:not([readonly]), input[type="datetime-local"]:not(.browser-default):focus:not([readonly]), input[type="tel"]:not(.browser-default):focus:not([readonly]), input[type="number"]:not(.browser-default):focus:not([readonly]), input[type="search"]:not(.browser-default):focus:not([readonly]), textarea.materialize-textarea:focus:not([readonly]) {
    border-bottom: 1px solid black;
    -webkit-box-shadow: 0 1px 0 0 black;
    box-shadow: 0 1px 0 0 black;
}
like image 20
smoore4 Avatar answered Sep 17 '22 11:09

smoore4