naive-ui/styles/Radio.scss

83 lines
2.1 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
@import './theme/default.scss';
@include b(radio) {
position: relative;
user-select: none;
2019-07-15 17:41:56 +08:00
display: inline-flex;
vertical-align: middle;
align-items: center;
margin-right: 18px;
.n-radio__control {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
transition: box-shadow .2s $default-cubic-bezier;
height: 14px;
width: 14px;
border-radius: 7px;
2019-07-15 17:41:56 +08:00
margin-right: 9px;
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 {
2019-07-15 17:41:56 +08:00
box-shadow: inset 0 0 0 1px rgba(99, 226, 183, 1);
&::before {
opacity: 1;
transform: scale(1);
2019-07-15 17:41:56 +08:00
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 {
2019-07-15 17:41:56 +08:00
transform: scale(1.5);
transform-origin: center;
2019-07-15 17:41:56 +08:00
opacity: 1;
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);
}
}
2019-07-15 17:41:56 +08:00
}
@include b(radio-group) {
display: inline-block;
vertical-align: middle;
}