naive-ui/styles/BaseCancelMark.scss
2019-11-06 15:57:03 +08:00

125 lines
3.5 KiB
SCSS

@import './mixins/mixins.scss';
@import './themes/vars.scss';
@include themes-mixin {
@include b(cancel-mark) {
@include once {
@include fade-in-transition(cancel-mark);
user-select: none;
display: inline-block;
position: relative;
height: 12px;
width: 12px;
vertical-align: bottom;
}
@include b(cancel-mark-cross) {
@include once {
@include fade-in-transition(cancel-mark);
position: absolute;
height: 12px;
width: 12px;
line-height: 12px;
border-radius: 8px;
overflow: hidden;
cursor: pointer;
}
@include e(icon) {
@include once {
transition: fill .3s $default-cubic-bezier;
}
fill: map-get($map: $--base-cancel-mark-cross-color, $key: "default");
}
@include m(arrow) {
@include e(icon) {
fill: map-get($map: $--base-cancel-mark-cross-color, $key: "hover");
}
}
&:hover {
@include e(icon) {
fill: map-get($map: $--base-cancel-mark-cross-color, $key: "hover");
}
}
&:active {
@include e(icon) {
fill: map-get($--base-cancel-mark-cross-color, "active");
}
}
}
@include b(cancel-mark-arrow) {
@include once {
@include fade-in-transition(cancel-mark);
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
border-radius: 8px;
overflow: hidden;
cursor: pointer;
}
&::after {
@include once {
transition: transform .3s $default-cubic-bezier, border-color .3s $default-cubic-bezier;
position: absolute;
content: '';
box-sizing: border-box;
width: 7px;
height: 7px;
right: 1px;
top: calc(50% - 4.5px);
transform: rotate(-45deg);
transform-origin: 30% 70%;
}
border-left: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'default');
border-bottom: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'default');
}
@include m(active) {
&::after {
@include once {
transform: rotate(135deg);
}
border-left: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'active');
border-bottom: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'active');
}
}
@include m(disabled) {
@include once {
cursor: not-allowed;
}
&::after {
border-color: rgba(255, 255, 255, 0.20);
}
}
}
}
@include as-form-item {
@include with-status(error) {
@include b(cancel-mark-cross) {
@include m(arrow) {
@include e(icon) {
fill: map-get($map: $--base-cancel-mark-cross-color, $key: "error-hover");
}
}
&:hover {
@include e(icon) {
fill: map-get($map: $--base-cancel-mark-cross-color, $key: "error-hover");
}
}
&:active {
@include e(icon) {
fill: map-get($--base-cancel-mark-cross-color, "error-active");
}
}
}
@include b(cancel-mark-arrow) {
@include m(active) {
&::after {
border-left: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'error-active');
border-bottom: 1px solid map-get($map: $--base-cancel-mark-arrow-color, $key: 'error-active');
}
}
}
}
}
}