naive-ui/styles/Transfer.scss

201 lines
6.2 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
@import './themes/vars.scss';
/**
* There are some theme related hard codes in transfer.
* Emmm, when I am writing these code I can't figure out a better solution.
* So just let it be.
* ...
* When I find myself in times of trouble
* blablabla
* ...
*/
2019-11-08 16:07:20 +08:00
@include themes-mixin {
@include b(transfer) {
@include once {
display: flex;
}
2019-11-08 16:07:20 +08:00
@include b(transfer-list) {
@include once {
background-clip: padding-box;
width: 182px;
height: 311px;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
border-radius: 6px;
}
background-color: map-get($--transfer-list-background-color, 'default');
border: 1px solid $--transfer-list-border-color;
2019-11-08 16:07:20 +08:00
@include b(transfer-list-header) {
@include once {
box-sizing: border-box;
margin: -1px -1px 0 -1px;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
display: flex;
border-radius: 6px 6px 0 0;
align-items: center;
height: 40px;
background-clip: padding-box;
@include e(checkbox) {
position: relative;
padding: 0 8px 0 14px;
@include b(checkbox) {
display: block;
}
2019-11-08 16:07:20 +08:00
}
}
background-color: map-get($--transfer-list-header-background-color, 'default');
border-top: 1px solid $--transfer-header-border-color;
border-left: 1px solid $--transfer-header-border-color;
border-right: 1px solid $--transfer-header-border-color;
2019-11-08 16:07:20 +08:00
@include e(header) {
@include once {
flex: 1;
line-height: 1;
font-size: 16px;
2019-12-23 16:48:49 +08:00
font-weight: 500;
transition: color .3s $--n-ease-in-out-cubic-bezier;
}
color: map-get($--transfer-list-header-text-color, 'default');
2019-11-08 16:07:20 +08:00
@include m(disabled) {
color: map-get($--transfer-list-header-text-color, 'disabled');
2019-11-08 16:07:20 +08:00
}
}
@include e(extra) {
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
font-size: 12px;
justify-self: flex-end;
margin-right: 14px;
white-space: nowrap;
}
color: map-get($--transfer-list-header-extra-text-color, 'default');
}
}
2019-11-08 16:07:20 +08:00
@include b(transfer-list-body) {
/** hard-code **/
@if $theme == 'dark' {
margin-left: -1px;
margin-right: -1px;
} @else {
padding: 0 1px;
2019-09-04 11:26:24 +08:00
}
@include once {
box-sizing: border-box;
overflow: hidden;
2019-09-04 11:26:24 +08:00
position: relative;
height: 272px;
border-bottom-right-radius: 6px;
border-bottom-left-radius: 6px;
@include b(scrollbar-content) {
width: 100%;
}
}
@include b(transfer-list-content) {
@include once {
padding: 0;
margin: 0;
position: relative;
}
2019-11-08 16:07:20 +08:00
@include b(transfer-list-light-bar) {
@include once {
@include fade-in-transition(transfer-list-light-bar);
height: 34px;
transition: top .15s $--n-ease-in-out-cubic-bezier;
width: 100%;
position: absolute;
}
2019-11-08 16:07:20 +08:00
background-color: map-get($--tranfer-item-lightbar-background-color, 'default');
2019-09-04 11:26:24 +08:00
}
2019-11-08 16:07:20 +08:00
@include b(transfer-list-item) {
@include once {
@include slide-right-transition(transfer-list-item-source);
@include slide-left-transition(transfer-list-item-target);
transition: color .3s $--n-ease-in-out-cubic-bezier;
position: relative;
cursor: pointer;
max-height: 34px;
display: flex;
align-items: center;
font-size: 14px;
height: 34px;
@include e(extra) {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
padding-right: 4px;
}
2019-11-08 16:07:20 +08:00
}
color: map-get($--transfer-item-text-color, 'default');
2019-11-08 16:07:20 +08:00
@include e(checkbox) {
@include once {
position: relative;
padding: 0 8px 0 14px;
@include b(checkbox) {
display: block;
}
}
@if $theme == 'dark' {
padding-left: 15px;
2019-11-08 16:07:20 +08:00
}
}
@include m(disabled) {
@include once {
cursor: not-allowed;
}
2019-11-08 16:07:20 +08:00
color: map-get($--transfer-item-text-color, 'disabled');
}
}
}
}
}
2019-11-08 16:07:20 +08:00
@include b(transfer-gap) {
@include once {
width: 96px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
2019-11-08 16:07:20 +08:00
@include b(transfer-button) {
@include once {
width: 36px;
height: 36px;
border-radius: 18px;
cursor: pointer;
&:first-child {
margin-bottom: 12px;
}
@include m(to) {
transform: rotate(180deg);
}
2019-09-04 11:26:24 +08:00
}
@include e(icon) {
@include once {
pointer-events: none;
transition: fill .3s $--n-ease-in-out-cubic-bezier;
}
2019-11-08 16:07:20 +08:00
fill: map-get($--transfer-gap-button-background-color, 'default');
2019-09-04 11:26:24 +08:00
}
2019-11-08 16:07:20 +08:00
&:hover {
@include e(icon) {
fill: map-get($--transfer-gap-button-background-color, 'hover');
}
}
&:active {
@include e(icon) {
fill: map-get($--transfer-gap-button-background-color, 'active');
}
}
@include m(disabled) {
@include once {
cursor: not-allowed;
}
2019-11-08 16:07:20 +08:00
@include e(icon) {
fill: map-get($--transfer-gap-button-background-color, 'disabled') !important;
}
2019-09-04 11:26:24 +08:00
}
}
}
}
}