improved accessibility (#425)

This commit is contained in:
FezVrasta 2015-03-09 18:01:22 +01:00
parent c42cd9cf06
commit 33b164294e

View File

@ -1,95 +1,100 @@
.form-horizontal .radio { .form-horizontal .radio {
margin-bottom: 10px; margin-bottom: 10px;
} }
.radio { .radio {
label { label {
cursor: pointer; cursor: pointer;
padding-left: 45px; padding-left: 45px;
position: relative; position: relative;
span { span {
display: block; display: block;
position: absolute; position: absolute;
left: 10px; left: 10px;
top: 2px; top: 2px;
transition-duration: 0.2s; transition-duration: 0.2s;
}
.circle {
border: 2px solid @lightbg-text;
height: 15px;
width: 15px;
border-radius: 100%;
}
.check {
height: 15px;
width: 15px;
border-radius: 100%;
background-color: @radio-default;
transform: scale(0);
}
.check:after {
display: block;
position: absolute;
content: "";
background-color: @lightbg-text;
left: -18px;
top: -18px;
height: 50px;
width: 50px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
transform: scale(1.5);
}
input[type=radio]:not(:checked) ~ .check:after {
animation: rippleOff 500ms;
}
input[type=radio]:checked ~ .check:after {
animation: rippleOn 500ms;
}
} }
.variations(~" input[type=radio]:checked ~ .check", background-color, @radio-default); .circle {
.variations(~" input[type=radio]:checked ~ .circle", border-color, @radio-default); border: 2px solid @lightbg-text;
height: 15px;
input[type=radio][disabled] ~ .check, width: 15px;
input[type=radio][disabled] ~ .circle { border-radius: 100%;
opacity: 0.5; }
.check {
height: 15px;
width: 15px;
border-radius: 100%;
background-color: @radio-default;
transform: scale(0);
}
.check:after {
display: block;
position: absolute;
content: "";
background-color: @lightbg-text;
left: -18px;
top: -18px;
height: 50px;
width: 50px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
transform: scale(1.5);
}
input[type=radio]:not(:checked) ~ .check:after {
animation: rippleOff 500ms;
}
input[type=radio]:checked ~ .check:after {
animation: rippleOn 500ms;
} }
input[type=radio] { display: none; } }
input[type=radio]:checked ~ .check { .variations(~" input[type=radio]:checked ~ .check", background-color, @radio-default);
transform: scale(0.55); .variations(~" input[type=radio]:checked ~ .circle", border-color, @radio-default);
}
input[type=radio][disabled] ~ .circle { input[type=radio][disabled] ~ .check,
border-color: @lightbg-text; input[type=radio][disabled] ~ .circle {
} opacity: 0.5;
input[type=radio][disabled] ~ .check { }
background-color: @lightbg-text;
} input[type=radio] {
opacity: 0;
height: 0;
width: 0;
overflow: hidden;
} }
input[type=radio]:checked ~ .check {
transform: scale(0.55);
}
input[type=radio][disabled] ~ .circle {
border-color: @lightbg-text;
}
input[type=radio][disabled] ~ .check {
background-color: @lightbg-text;
}
} }
@keyframes rippleOn { @keyframes rippleOn {
0% { 0% {
opacity: 0; opacity: 0;
} }
50% { 50% {
opacity: 0.2; opacity: 0.2;
} }
100% { 100% {
opacity: 0; opacity: 0;
} }
} }
@keyframes rippleOff { @keyframes rippleOff {
0% { 0% {
opacity: 0; opacity: 0;
} }
50% { 50% {
opacity: 0.2; opacity: 0.2;
} }
100% { 100% {
opacity: 0; opacity: 0;
} }
} }