Skip to content
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

Custom color of input underline #192

Closed
zigy opened this issue Dec 5, 2014 · 14 comments
Closed

Custom color of input underline #192

zigy opened this issue Dec 5, 2014 · 14 comments

Comments

@zigy
Copy link

zigy commented Dec 5, 2014

Please can you add custom color of input underline animation to css?
Default is blue... i need orange 😋

@bsteephenson
Copy link

In bin/materialize.css

textarea:focus {
  border-bottom: 1px solid #03a9f4;
  -webkit-box-shadow: 0 1px 0 0 #03a9f4;
  -moz-box-shadow: 0 1px 0 0 #03a9f4;
  box-shadow: 0 1px 0 0 #03a9f4;
}

You can replace the color code with whatever you want to change the underline.

textarea:focus {
  border-bottom: 1px solid orange;
  -webkit-box-shadow: 0 1px 0 0 orange;
  -moz-box-shadow: 0 1px 0 0 orange;
  box-shadow: 0 1px 0 0 orange;
}

Would be great if we could do this programatically.

@acburst
Copy link
Collaborator

acburst commented Dec 6, 2014

We are thinking of a way to do this programmatically but for now you should just overwrite it in your own CSS. Its best not to alter our CSS file if you ever intend on updating

@zigy
Copy link
Author

zigy commented Dec 6, 2014

Thanks a lot :)

@Dogfalo
Copy link
Owner

Dogfalo commented Mar 8, 2015

Documentation and Sass variables added.

@Dogfalo Dogfalo closed this as completed Mar 8, 2015
@ghost
Copy link

ghost commented Apr 30, 2016

Is there a way to do it programatically ?

@gauravbankoti
Copy link

Bro its not working

@greg-mckeon
Copy link

Not sure why, but this works for me:
.input-field textarea[class=materialize-textarea]:focus {
border-bottom: 1px solid #2196f3;
box-shadow: 0 1px 0 0 #2196f3;
}

@shinux
Copy link

shinux commented Jun 22, 2016

i customized the border color by (lang=pug):

input[type=text]
  &:focus:not([readonly])
    border-bottom: 1px solid #0C8CF6
    box-shadow: 0 1px 0 0 #0C8CF6

@piq9117
Copy link

piq9117 commented Aug 19, 2016

Theres a guide how to target the input elements. How about the textarea? How do I change it?

update:
I targeted the default ID.

#textarea1:focus {
  border-bottom: 1px solid red;
  box-shadow: 0 1px 0 0 red;
}

#textarea1:focus + label {
  color: red;
}

@vTrip
Copy link

vTrip commented May 15, 2017

Is there any update on this ?

@gauravbankoti
Copy link

gauravbankoti commented May 15, 2017 via email

@vTrip
Copy link

vTrip commented May 15, 2017

I have done this, except the existing border applied from the mdl is present with the border style I apply

.mdl-textfield__input:focus

@mateusbfroemming
Copy link

in: theme/variables.css add this code:

$text-input-md-highlight-color-invalid: transparent;
$text-input-md-highlight-color-valid: transparent;
$text-input-md-show-invalid-highlight: transparent;
$text-input-md-highlight-color: transparent;
$text-input-md-show-valid-highlight: transparent;

but select a color!

@ray-den
Copy link

ray-den commented Apr 12, 2021

try this. its work for me fine:

.input-field input:focus + label {
color: red !important;
}

.row .input-field input:focus {
border-bottom: 1px solid red !important;
box-shadow: 0 1px 0 0 red !important
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests