2

I am just wondering if there is any way to style md-checkbox like given below:

Codepen code for input checkbox

Note: I just wanna change the border color of the checkbox.

I have tried following way but didn't succeed :

SCSS

$dal-green: #45ba8e;
    .check{
    md-checkbox {
      border: 2px solid $dal-green; 
    }
    }

HTML :

     <div class="check"> 
<md-checkbox></md-checkbox>
</div>

I have searched online but no luck . If any body can give css to override the border color it would be great help. Thanks In advance.

user2936008
  • 1,317
  • 5
  • 19
  • 42
  • it seems `` creates `
    ` which defaults to an unchecked box area. Try applying css to this `.md-icon` I learnt it from here, github.com/angular/material/issues/2832 (the last comment)
    – Sudhansu Choudhary Jun 23 '15 at 20:15

3 Answers3

2

Try this,

.check{
md-checkbox {
  border: 2px solid #009688; 
}
}
Sudhansu Choudhary
  • 3,322
  • 3
  • 19
  • 30
  • Its not working color is not a problem here assigning color to the border of the checkbox. – user2936008 Jun 23 '15 at 19:45
  • it seems `` creates `
    ` which defaults to an unchecked box area. Try applying css to this `.md-icon` I learnt it from here, https://github.com/angular/material/issues/2832 (the last comment)
    – Sudhansu Choudhary Jun 23 '15 at 20:13
0

Try something like this :

md-checkbox .md-icon {
  border-color: green;
}
Ellone
  • 3,644
  • 12
  • 40
  • 72
0

in new version you should use with underscore _md-icon:

        md-checkbox.md-checked ._md-icon {
         background-color: transparent;
        }


        md-checkbox ._md-icon {
        border-color: white;
        }
Stav Bodik
  • 2,018
  • 3
  • 18
  • 25