css - How to change the colour of the label of md-input-container label after a text is inserted -
how change colour of md-input-container label after contains input? don't want grey, because makes it's greyed out. example, want change colour of label "description" after/when input field contains input. have tried modifying md-input-container label in css using code doesn't work :
md-input-container.md-default-theme label, md-input-container.md-default-theme .md-placeholder { color: #fdfe67 !important; }
here html:
<div ng-app="myapp" ng-controller="democtrl" layout="column" ng-cloak="" class="md-inline-form inputdemobasicusage"> <md-content layout-padding=""> <div> <form name="userform"> <md-input-container class="md-block"> <label>input-autofocus</label> <input ng-model="user.firstname" type="text" autofocus> </md-input-container> <md-input-container class="md-block"> <label>input-md-autofocus</label> <input ng-model="user.title" type="text" md-autofocus> </md-input-container> </form> </div> </md-content> </div>
here angular :
angular .module('myapp', ['ngmaterial', 'ngmessages']) .controller('democtrl', function($scope) { });
here code on codepen: http://codepen.io/zcook/pen/bpxgwj
if want label colour change when has input can use...
.md-inline-form md-input-container.md-input-has-value label{ color: red; }
if want label color change after user entered input moved focus away can use...
.md-inline-form md-input-container.md-input-has-value:not(.md-input-focused) label{ color: red; }
Comments
Post a Comment