jdvue
Version:
A Vue.js 2.0 Mobile UI components at JinDanLiCai
185 lines (170 loc) • 3.99 kB
text/less
@radio-prefix-cls: ~"@{css-prefix}radio";
@radio-group-prefix-cls: ~"@{radio-prefix-cls}-group";
@radio-inner-prefix-cls: ~"@{radio-prefix-cls}-inner";
@cursor-disabled: ~"not-allowed";
@border: ~"#e6e8eb";
.@{radio-group-prefix-cls} {
display: inline-block;
font-size: 14px;
vertical-align: middle;
width: 100%; //outline: none;
&-vertical {
.@{radio-prefix-cls}-wrapper {
display: block;
line-height: 1.4;
}
}
}
.@{radio-prefix-cls}-text-wrapper {
padding-left: 20px;
display: inline-block;
position: relative;
top: 2px;
}
.@{radio-prefix-cls}-small {
font-size: 14px;
.@{radio-prefix-cls} .@{radio-inner-prefix-cls} {
width: 12px;
height: 12px;
top: 1px;
span {
width: 4px;
height: 4px;
left: 3px;
top: 3px;
border-radius: 50%;
}
}
&.@{radio-prefix-cls}-wrapper,
& .@{radio-prefix-cls}-wrapper {
font-size: 14px;
}
.@{radio-prefix-cls}-text-wrapper {
padding-left: 18px;
}
}
.@{radio-prefix-cls}-large {
font-size: 18px;
.@{radio-prefix-cls} .@{radio-inner-prefix-cls} {
width: 18px;
height: 18px;
top: 0;
span {
width: 8px;
height: 8px;
left: 4px;
top: 4px;
border-radius: 50%;
}
}
&.@{radio-prefix-cls}-wrapper,
& .@{radio-prefix-cls}-wrapper {
font-size: 18px;
}
.@{radio-prefix-cls}-text-wrapper {
padding-left: 22px;
}
}
.@{radio-group-prefix-cls} .@{radio-prefix-cls}-small {
& .@{radio-inner-prefix-cls} {
top: 3px;
}
}
.@{radio-group-prefix-cls} .@{radio-prefix-cls}-large {
& .@{radio-inner-prefix-cls} {
top: 5px;
}
}
// 普通状态 - Normal state
.@{radio-prefix-cls}-wrapper {
font-size: 16px;
vertical-align: middle;
display: inline-block;
position: relative;
margin-right: 8px;
cursor: pointer;
&-disabled {
cursor: @cursor-disabled;
} //outline: none;
}
.@{radio-prefix-cls} {
display: inline-block;
margin-right: 4px; //outline: none;
position: absolute;
line-height: 1;
vertical-align: middle;
cursor: pointer;
.@{radio-inner-prefix-cls} {
display: inline-block;
width: 15px;
height: 15px;
position: relative;
top: 0;
left: 0;
background-color: #fff;
border: 1px solid @border;
border-radius: 50%;
box-sizing: border-box;
span {
position: absolute;
width: 7px;
height: 7px;
left: 3px;
top: 3px;
border-radius: 50%;
display: table;
border-top: 0;
border-left: 0;
content: ' ';
background-color: @green;
opacity: 0;
transform: scale(0);
}
}
&-input {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1;
opacity: 0;
cursor: pointer;
}
}
.@{radio-group-prefix-cls} {
.@{radio-inner-prefix-cls} {
top: 3px;
}
}
// 选中状态 - Selected state
.@{radio-prefix-cls}-checked {
.@{radio-inner-prefix-cls} {
border-color: @green;
span {
opacity: 1;
transform: scale(1);
transition: all .2s ease-in-out;
}
}
}
.@{radio-prefix-cls}-disabled {
cursor: @cursor-disabled;
.@{radio-prefix-cls}-input {
cursor: @cursor-disabled;
}
.@{radio-inner-prefix-cls} {
border-color: @border;
background-color: #f3f3f3;
&:after {
background-color: #cccccc;
}
}
.@{radio-prefix-cls}-disabled+span {
color: #ccc;
}
}
span.@{radio-prefix-cls}+* {
margin-left: 2px;
margin-right: 2px;
}