naive-ui/styles/Radio.scss

74 lines
1.9 KiB
SCSS

@import './mixins/mixins.scss';
@import './theme/default.scss';
@include b(radio) {
position: relative;
user-select: none;
.n-radio__control {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
transition: box-shadow .2s $default-cubic-bezier;
vertical-align: middle;
display: inline-block;
height: 14px;
width: 14px;
border-radius: 7px;
margin-right: 12px;
position: relative;
&::before {
content: "";
position: absolute;
left: 3px;
top: 3px;
height: 8px;
width: 8px;
border-radius: 4px;
transform: scale(.8);
background-color: rgba(99, 226, 183, 1);
opacity: 0;
transition: opacity .15s $slow-out-cubic-bezier, transform .15s $slow-out-cubic-bezier;
}
&.n-radio__control--checked {
&::before {
opacity: 1;
transform: scale(1);
transition: opacity .15s $fast-in-cubic-bezier, transform .15s $fast-in-cubic-bezier;
}
}
}
.n-radio__label {
display: inline-block;
color: rgba(233,233,236,1);
}
&:not(.n-radio--disabled) {
cursor: pointer;
&:hover .n-radio__control {
box-shadow: inset 0 0 0 1px rgba(99, 226, 183, 1);
transition: box-shadow .2s $default-cubic-bezier;
}
&:active .n-radio__control {
box-shadow: inset 0 0 0 1px rgba(99, 226, 183, 1), 0px 0px 10px 1px rgba(99,226,183,0.3);
}
}
&.n-radio--disabled {
cursor: not-allowed;
.n-radio__control {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
transition: box-shadow .2s $default-cubic-bezier;
&::before {
transform: scale(.8);
transform-origin: center;
opacity: 0;
background-color: rgba(233,233,236,0.25);
}
&.n-radio__control--checked {
&::before {
transform: scale(1);
opacity: 1;
}
}
}
.n-radio__label {
color: rgba(233,233,236,0.25);
}
}
}