naive-ui/styles/Upload.scss

173 lines
5.1 KiB
SCSS
Raw Normal View History

@import 'mixins/mixins.scss';
@include themes-mixin {
@include b(upload) {
2020-02-21 11:25:01 +08:00
@include once {
@include e(file-input) {
2020-02-18 13:06:29 +08:00
display: block;
2020-02-21 11:25:01 +08:00
width: 0;
height: 0;
opacity: 0;
2020-02-18 13:06:29 +08:00
}
2020-02-18 20:09:34 +08:00
@include e(activator) {
2020-02-21 11:25:01 +08:00
display: inline-block;
2020-02-18 20:09:34 +08:00
}
2020-02-21 11:25:01 +08:00
@include m(dragger-inside) {
@include e(activator) {
display: block;
}
2020-02-18 13:06:29 +08:00
}
}
@include b(upload-dragger) {
2020-02-21 11:25:01 +08:00
@include once {
cursor: pointer;
box-sizing: border-box;
width: 100%;
text-align: center;
2020-02-28 22:57:10 +08:00
border-radius: $--n-upload-border-radius;
2020-02-21 11:25:01 +08:00
padding: 24px;
transition:
border-color .3s $--n-ease-in-out-cubic-bezier,
background-color .3s $--n-ease-in-out-cubic-bezier;
}
background-color: map-get($--upload-dragger-background-color, 'default');
border: 1px dashed map-get($--upload-dragger-border-color, 'default');
2020-02-18 13:06:29 +08:00
&:hover {
2020-02-21 11:25:01 +08:00
border-color: map-get($--upload-dragger-border-color, 'hover');
2020-02-18 13:06:29 +08:00
}
}
2020-02-16 21:52:38 +08:00
@include b(upload-file-list) {
2020-02-21 11:25:01 +08:00
@include once {
margin-top: 8px;
2020-02-22 14:11:34 +08:00
line-height: 1.75;
2020-02-21 11:25:01 +08:00
}
2020-02-16 21:52:38 +08:00
@include b(upload-file) {
2020-02-21 11:25:01 +08:00
@include once {
@include fade-in-height-expand-transition;
display: block;
box-sizing: border-box;
cursor: default;
padding: 0px 12px 0 6px;
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
2020-02-28 22:57:10 +08:00
border-radius: $--n-upload-border-radius;
2020-02-21 11:25:01 +08:00
@include b(progress) {
@include fade-in-height-expand-transition($fold-padding: true);
box-sizing: border-box;
padding-bottom: 6px;
margin-bottom: 6px;
}
}
2020-02-16 21:52:38 +08:00
&:hover {
background-color: map-get($--upload-file-item-background-color, 'hover');
2020-02-21 11:25:01 +08:00
@include once {
@include b(upload-file-info) {
@include e(action) {
opacity: 1;
}
2020-02-16 21:52:38 +08:00
}
}
}
@include m(error-status) {
2020-02-18 15:15:42 +08:00
&:hover {
background-color: map-get($--upload-file-item-background-color, 'error-hover');
}
2020-02-16 21:52:38 +08:00
@include b(upload-file-info) {
@include e(name) {
2020-02-21 11:25:01 +08:00
color: map-get($--upload-info-text-color, 'error');
2020-02-16 21:52:38 +08:00
}
}
}
@include m(success-status) {
2020-02-18 15:15:42 +08:00
@include b(upload-file-info) {
@include e(name) {
2020-02-21 11:25:01 +08:00
color: map-get($--upload-info-text-color, 'success');
2020-02-18 15:15:42 +08:00
}
}
2020-02-18 13:06:29 +08:00
}
@include m(with-url) {
2020-02-21 11:25:01 +08:00
@include once {
cursor: pointer;
}
2020-02-16 21:52:38 +08:00
@include b(upload-file-info) {
@include e(name) {
2020-02-21 11:25:01 +08:00
@include once {
text-decoration: underline;
}
color: map-get($--upload-info-text-color, 'success');
text-decoration-color: map-get($--upload-info-text-color, 'success');
2020-02-16 21:52:38 +08:00
}
}
}
@include b(upload-file-info) {
2020-02-21 11:25:01 +08:00
@include once {
position: relative;
padding-top: 6px;
padding-bottom: 6px;
@include e(action) {
padding-top: inherit;
padding-bottom: inherit;
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 80px;
display: flex;
align-items: center;
transition: opacity .2s $--n-ease-in-out-cubic-bezier;
flex-direction: row-reverse;
opacity: 0;
@include b(button) {
&:not(:first-child) {
margin-right: 8px;
}
@include b(icon) {
svg {
@include icon-switch-transition;
}
}
}
}
2020-02-16 21:52:38 +08:00
}
2020-02-21 11:25:01 +08:00
@include e(name) {
@include once {
text-overflow: ellipsis;
overflow: hidden;
text-decoration: underline;
text-decoration-color: transparent;
font-size: 14px;
transition:
color .3s $--n-ease-in-out-cubic-bezier,
text-decoration-color .3s $--n-ease-in-out-cubic-bezier;
}
@include b(icon) {
@include once {
font-size: 18px;
margin-right: 2px;
vertical-align: middle;
}
2020-02-21 11:25:01 +08:00
fill: map-get($--upload-info-icon-color, 'default');
stroke: map-get($--upload-info-icon-color, 'default');
2020-02-16 21:52:38 +08:00
}
2020-02-21 11:25:01 +08:00
color: map-get($--upload-info-text-color, 'default');
2020-02-16 21:52:38 +08:00
}
}
2020-02-21 11:25:01 +08:00
}
}
@include m(disabled) {
opacity: $--upload-disabled-opacity;
@include once {
@include e(activator) {
cursor: not-allowed;
2020-02-16 21:52:38 +08:00
}
2020-02-21 11:25:01 +08:00
@include b(upload-file-list) {
cursor: not-allowed;
}
}
}
@include m(drag-over) {
@include b(upload-dragger) {
border-color: map-get($--upload-dragger-border-color, 'hover');
2020-02-16 21:52:38 +08:00
}
}
}
}