Materialize: change color radio input

Created on 11 Jun 2015  路  6Comments  路  Source: Dogfalo/materialize

Hey! i wanna know if it's possible change the color of input radio whit external css file. or how know with sass downloading materialize which variable change

thanks for the help

Most helpful comment

[type="radio"].with-gap:checked + label:before {
border-radius: 50%;
border: 2px solid #0277bd; }

[type="radio"].with-gap:checked + label:after {
border-radius: 50%;
border: 2px solid #0277bd;
background-color: #0277bd;
z-index: 0;
-webkit-transform: scale(.5);
-moz-transform: scale(.5);
-ms-transform: scale(.5);
-o-transform: scale(.5);
transform: scale(.5); }

All 6 comments

hey! I already solved!
Thanks anyway!

What did you do? I cannot find a reliable way to switch checkbox colors.

[type="radio"].with-gap:checked + label:before {
border-radius: 50%;
border: 2px solid #0277bd; }

[type="radio"].with-gap:checked + label:after {
border-radius: 50%;
border: 2px solid #0277bd;
background-color: #0277bd;
z-index: 0;
-webkit-transform: scale(.5);
-moz-transform: scale(.5);
-ms-transform: scale(.5);
-o-transform: scale(.5);
transform: scale(.5); }

type="radio".with-gap:checked+label:before,
type="radio".with-gap:checked+label:after {
border: 2px solid black !important;
}

type="radio".with-gap:checked+label:after {
background-color: #424242 !important;
}

If you're using Less, you could use this mixin:

.radio-color(@border-color, @background-color: @border-color, @border-color-checked: @border-color) {
    [type="radio"].with-gap {
        &+label:before,
        &+label:after {
            border: 2px solid @border-color !important;
        }
        &:checked+label:before,
        &:checked+label:after {
            border: 2px solid @border-color-checked !important;
        }
        &:checked+label:after {
            background-color: @background-color !important;
        }
    }
}

it does not work for me(all of them)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericlormul picture ericlormul  路  3Comments

ReiiYuki picture ReiiYuki  路  3Comments

lpgeiger picture lpgeiger  路  3Comments

onigetoc picture onigetoc  路  3Comments

acierpinski picture acierpinski  路  3Comments