public.components.flat-ui.less.modules.checkbox-and-radio.less Maven / Gradle / Ivy
//
// Checkbox & Radio
// --------------------------------------------------
.checkbox,
.radio {
margin-bottom: 12px;
padding-left: 32px;
position: relative;
.transition(color .25s linear);
font-size: ceil(@component-font-size-base * 0.933); // ~14px
line-height: 1.5; // 21px;
input {
outline: none !important;
display: none;
}
// Replace icons
// --------------------------------------------------
.icons {
color: @gray-light;
display: block;
height: 20px;
left: 0;
position: absolute;
top: 0;
width: 20px;
text-align: center;
line-height: 21px;
font-size: 20px;
cursor: pointer;
.transition(color .25s linear);
.first-icon,
.second-icon {
display: inline-table;
position: absolute;
left: 0;
top: 0;
background-color: transparent;
margin: 0;
.opacity(1);
}
.second-icon {
.opacity(0);
}
}
// Alternate States
// --------------------------------------------------
// Hover State
&:hover {
.transition(color .25s linear);
.first-icon {
.opacity(0);
}
.second-icon {
.opacity(1);
}
}
// Checked State
&.checked {
color: @brand-secondary;
.first-icon {
.opacity(0);
}
.second-icon {
.opacity(1);
color: @brand-secondary;
.transition(color .25s linear);
}
}
// Disabled state
&.disabled {
cursor: default;
color: mix(@gray-light, white, 38%);
.icons {
color: mix(@gray-light, white, 38%);
}
.first-icon {
.opacity(1);
}
.second-icon {
.opacity(0);
}
&.checked {
.icons {
color: mix(@gray-light, white, 38%);
}
.first-icon {
.opacity(0);
}
.second-icon {
.opacity(1);
color: mix(@gray-light, white, 38%);
}
}
}
// Alternate Color
// --------------------------------------------------
// Primary
&.primary {
.icons {
color: @brand-primary;
}
// Checked State
&.checked {
color: @brand-secondary;
.icons {
color: @brand-secondary;
}
}
// Disabled state
&.disabled {
cursor: default;
color: @gray-light;
.icons {
color: @gray-light;
}
&.checked {
.icons {
color: @gray-light;
}
}
}
}
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: 10px;
}