Zhenqi Zhu Zhenqi Zhu - 1 month ago 8
CSS Question

How can I change colors of google Icons when I'm using Materialize css?

I created a form for login like followed picture:
enter image description here

When I don't fill in anything, the icon will have black color like the email line otherwise it'll turn green like the password line. I believe its kind of default settings and apparently this is not a good color combination. I'd like to change it but as a noob here I have no idea which attribute I should change...

all css I used come from http://materializecss.com/

Here is my code of this form:

<div class="container">
<div class="row">
<form class="col s8 offset-s2" role="form" method="POST" action="{{ url('/login') }}">
{!! csrf_field() !!}
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input value="Hi" type="email" class="validate" name="email" value="{{ old('email') }}">
<label for="email">Email</label>
</div>
</div>

<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">dialpad</i>
<label class="active" for="password">Password</label>
<input value=" " type="password" class="validate" name="password">
</div>
</div>
<div class="row">
<div class="checkbox col s3">
<p>
<input type="checkbox" name="remember" id="checkbox_remember"/>
<label for="checkbox_remember">Remember Me</label>
</p>
</div>
<div class="col s4">
<button type="submit" class="waves-effect waves-light btn">
<i class="material-icons left">cloud</i>Login</a>
</button>
</div>
<div class="col s5">
<a class="waves-effect waves-light btn right" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
</div>
</div>
</form>
</div>
</div>

Answer

Just modify the css:

.material-icons {
  color: your color of choice;
  }

for the default value, and:

.material-icons.active {
      color: your color of choice;
    }

when the input is selected (focused).

Comments