google MDL textfield focus to change color

╄→尐↘猪︶ㄣ 提交于 2019-12-06 06:10:18

I have it all. The keys are the :after modifier and the is-focused class. Just replace #FAFAFA with your indigo-pink and it should work for ya. This is just proof of concept. Check the fiddle. it has the text label colored too.

.mdl-textfield.is-focused .mdl-textfield__label {
    color: #FAFAFA;
}

.mdl-textfield__label:after{
    background-color: #FAFAFA;
}

https://jsfiddle.net/90u6Lxc4/30/

I believe an alternate solution would be like this, it worked for me:

.mdl-textfield__input:focus {
    border-bottom-color: red;
    box-shadow: 0 1px 0 0 red;
}

I deducted the answer from here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!