zmp-ui
Version:
Zalo Mini App framework
182 lines (153 loc) • 3.9 kB
text/less
@import './variables.less';
@import './mixins.less';
.@{radio-prefix-cls}-group {
box-sizing: border-box;
margin: 0;
padding: 0;
display: inline-block;
&-item {
&:not(:last-child) {
margin-right: 8px;
}
}
.@{radio-prefix-cls}-wrapper {
&:not(:last-child) {
margin-right: 8px;
}
}
}
.@{radio-prefix-cls} {
box-sizing: border-box;
margin: 0;
padding: 0;
cursor: pointer;
position: relative;
width: @radio-size;
height: @radio-size;
&-checkmark {
width: 100%;
height: 100%;
display: block;
position: relative;
background-color: @light-radio-uncheck-background;
border-radius: @radio-radius;
border: @radio-border-width solid @light-radio-border-color;
}
&-disabled {
.@{radio-prefix-cls}-checkmark {
background-color: @light-radio-disabled-uncheck-background;
}
}
&-checked {
.@{radio-prefix-cls}-checkmark {
background-color: @light-radio-checked-background;
border: none ;
color: @light-radio-checked-mark-color;
&::after {
position: absolute;
width: @radio-checkmark-size;
height: @radio-checkmark-size;
border-radius: 100%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: @light-radio-checked-mark-color;
content: '';
}
}
&.@{radio-prefix-cls}-disabled {
.@{radio-prefix-cls}-checkmark {
background-color: @light-radio-disabled-checked-background;
&::after {
background-color: @light-radio-disabled-checked-mark-color;
}
}
}
}
&-small {
.@{radio-prefix-cls} {
width: @radio-small-size;
height: @radio-small-size;
}
.@{radio-prefix-cls}-checkmark {
border: @radio-small-border-width solid @light-radio-border-color;
border-radius: @radio-small-radius;
&::after {
width: @radio-small-checkmark-size;
height: @radio-small-checkmark-size;
}
}
}
&-wrapper {
position: relative;
display: inline-flex;
align-items: center;
font-size: @radio-label-font-size;
line-height: @radio-label-line-height;
font-weight: @radio-label-font-weight;
&.@{radio-prefix-cls}-small {
font-size: @radio-small-label-font-size;
line-height: @radio-small-label-line-height;
font-weight: @radio-small-label-font-weight;
}
}
&-input {
position: absolute;
box-sizing: border-box;
padding: 0;
margin: 0;
outline: none;
border: none;
z-index: 1;
width: 100%;
height: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
cursor: pointer;
opacity: 0;
display: block;
}
+span {
margin-left: 8px;
display: inline-block;
flex: 1;
}
}
.if-dark-theme( {
.@{radio-prefix-cls} {
&-checkmark {
background-color: @dark-radio-uncheck-background;
border: @radio-border-width solid @dark-radio-border-color;
}
&-disabled {
.@{radio-prefix-cls}-checkmark {
background-color: @dark-radio-disabled-uncheck-background;
}
}
&-checked {
.@{radio-prefix-cls}-checkmark {
background-color: @dark-radio-checked-background;
border: none ;
&::after {
background-color: @dark-radio-checked-mark-color;
}
}
&.@{radio-prefix-cls}-disabled {
.@{radio-prefix-cls}-checkmark {
background-color: @dark-radio-disabled-checked-background;
&::after {
background-color: @dark-radio-disabled-checked-mark-color;
}
}
}
}
&-small {
.@{radio-prefix-cls}-checkmark {
border: @radio-small-border-width solid @dark-radio-border-color;
}
}
}
}
);