@talentsoft-opensource/hylia
Version:
The Hylia design systems. Contains all the building blocks style rules for Talentsoft.
143 lines (112 loc) • 3.21 kB
text/less
input[type="radio"] {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
border: 0;
}
.Hylia-a-inputRadio {
display: flex;
align-content: center;
cursor: pointer;
&__input {
&:checked:not(:disabled) {
& + .Hylia-a-inputRadio__apparence {
animation: onFocusChecked 1s;
border: 0.2rem solid @terran;
&:before {
background-color: @terran;
}
&:hover {
border-color: darken(@terran, 20%);
&:before {
background-color: darken(@terran, 20%);
}
}
}
}
// Style when Input is checked && disabled
&:checked:disabled {
& + .Hylia-a-inputRadio__apparence {
border: 0.2rem solid @apprentice;
background-color: @apprentice;
&:before {
background-color: @knight;
}
}
}
// Style when Input is disabled
&:disabled {
& + .Hylia-a-inputRadio__apparence {
border: 0.2rem solid @apprentice;
background-color: @apprentice;
&:before {
background-color: transparent;
}
}
}
&:focus {
&:checked:not(:disabled) {
& + .Hylia-a-inputRadio__apparence {
box-shadow: 0 0 0 0.3rem fade(@terran, 30%);
}
}
&:not(:disabled) {
& + .Hylia-a-inputRadio__apparence {
box-shadow: 0 0 0 0.3rem fade(@apprentice, 30%);
}
}
}
&:focus:disabled {
& + .Hylia-a-inputRadio__apparence {
animation: onFocus 1s;
}
}
}
&__apparence {
position: relative;
display: inline-block;
width: 1.6rem;
height: 1.6rem;
margin-right: 1rem;
cursor: pointer;
transition: 0.5s all;
border: 0.2rem solid @minion;
border-radius: 50%;
&:before {
position: absolute;
top: 50%;
left: 50%;
display: block;
width: 0.8rem;
height: 0.8rem;
content: "";
transition: all 0.5s ease-out;
transform: translate(-50%, -50%);
border-radius: 50%;
background-color: transparent;
}
&:hover {
border-color: darken(@minion, 20%);
}
}
}
@keyframes onFocusChecked {
0% {
box-shadow: 0 0 0 0 @terran;
}
100% {
box-shadow: 0 0 0 0.6rem fade(@terran, 0);
}
}
@keyframes onFocus {
0% {
box-shadow: 0 0 0 0 @apprentice;
}
100% {
box-shadow: 0 0 0 0.6rem fade(@apprentice, 0);
}
}