naive-ui/styles/Upload.scss

149 lines
4.2 KiB
SCSS
Raw Normal View History

@import 'mixins/mixins.scss';
@include themes-mixin {
@include b(upload) {
2020-02-18 13:06:29 +08:00
@include m(dragger-inside) {
@include e(activator) {
display: block;
}
}
2020-02-18 19:24:45 +08:00
@include m(disabled) {
opacity: .4;
2020-02-18 20:09:34 +08:00
@include e(activator) {
cursor: not-allowed;
}
@include b(upload-file-list) {
cursor: not-allowed;
}
2020-02-18 19:24:45 +08:00
}
2020-02-18 13:06:29 +08:00
@include m(drag-over) {
@include b(upload-dragger) {
2020-02-19 19:58:39 +08:00
border-color: $--n-primary-color;
2020-02-18 13:06:29 +08:00
}
}
@include b(upload-dragger) {
cursor: pointer;
box-sizing: border-box;
width: 100%;
2020-02-19 21:08:31 +08:00
background-color: $--n-action-background-color;
2020-02-18 13:06:29 +08:00
text-align: center;
border-radius: 6px;
2020-02-19 15:38:44 +08:00
border: 1px dashed $--n-border-color;
2020-02-18 13:06:29 +08:00
padding: 24px;
2020-02-18 15:15:42 +08:00
transition: border-color .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
2020-02-18 13:06:29 +08:00
&:hover {
2020-02-19 19:58:39 +08:00
border-color: $--n-primary-color;
2020-02-18 13:06:29 +08:00
}
}
@include e(file-input) {
2020-02-18 13:06:29 +08:00
display: block;
width: 0;
height: 0;
opacity: 0;
}
2020-02-16 21:52:38 +08:00
@include e(activator) {
display: inline-block;
}
@include b(upload-file-list) {
margin-top: 8px;
line-height: 1.5;
@include b(upload-file) {
@include fade-in-height-expand-transition;
2020-02-18 13:06:29 +08:00
display: block;
box-sizing: border-box;
2020-02-18 15:15:42 +08:00
cursor: default;
padding: 0px 12px 0 6px;
2020-02-16 21:52:38 +08:00
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
border-radius: 6px;
&:hover {
background-color: map-get($--upload-file-item-background-color, 'hover');
@include b(upload-file-info) {
@include e(action) {
opacity: 1;
}
}
}
@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-19 21:08:31 +08:00
color: $--n-error-color;
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-19 21:08:31 +08:00
color: $--n-success-color;
2020-02-18 15:15:42 +08:00
}
}
2020-02-18 13:06:29 +08:00
}
@include m(with-url) {
2020-02-18 15:15:42 +08:00
cursor: pointer;
2020-02-16 21:52:38 +08:00
@include b(upload-file-info) {
@include e(name) {
2020-02-19 21:08:31 +08:00
color: $--n-success-color;
2020-02-18 15:15:42 +08:00
text-decoration: underline;
2020-02-19 21:08:31 +08:00
text-decoration-color: $--n-success-color;
2020-02-16 21:52:38 +08:00
}
}
}
@include b(upload-file-info) {
position: relative;
padding-top: 6px;
2020-02-16 21:52:38 +08:00
padding-bottom: 6px;
@include e(name) {
text-overflow: ellipsis;
overflow: hidden;
2020-02-18 15:15:42 +08:00
text-decoration: underline;
text-decoration-color: transparent;
@include b(icon) {
font-size: 18px;
margin-right: 2px;
2020-02-19 13:36:29 +08:00
fill: $--n-tertiary-text-color;
stroke: $--n-tertiary-text-color;
vertical-align: middle;
}
2020-02-16 21:52:38 +08:00
font-size: 14px;
color: $--n-secondary-text-color;
2020-02-18 15:15:42 +08:00
transition:
color .3s $--n-ease-in-out-cubic-bezier,
text-decoration-color .3s $--n-ease-in-out-cubic-bezier;
2020-02-16 21:52:38 +08:00
}
@include e(action) {
padding-top: inherit;
2020-02-16 21:52:38 +08:00
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;
2020-02-18 13:06:29 +08:00
opacity: 0;
2020-02-16 21:52:38 +08:00
@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
}
}
}
@include b(progress) {
@include fade-in-height-expand-transition($fold-padding: true);
box-sizing: border-box;
padding-bottom: 6px;
2020-02-16 21:52:38 +08:00
margin-bottom: 6px;
}
}
}
}
}