naive-ui/styles/BaseSelectMenu.scss

129 lines
3.7 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
@import './themes/vars.scss';
2019-09-25 14:24:53 +08:00
@mixin base-select-size-mixin ($size) {
@include m($size + '-size') {
@include b(scrollbar-container) {
max-height: map-get($map: $--n-height, $key: $size) * 7.6;
}
2019-09-25 14:24:53 +08:00
@include e(item, light-bar) {
height: map-get($map: $--n-height, $key: $size);
line-height: map-get($map: $--n-height, $key: $size);
font-size: map-get($map: $--n-font-size, $key: $size);
}
}
2019-09-25 14:24:53 +08:00
}
@include themes-mixin {
@include b(base-select-menu) {
@include once {
@include base-select-size-mixin("small");
@include base-select-size-mixin("medium");
@include base-select-size-mixin("large");
outline: none;
margin-top: 4px;
margin-bottom: 4px;
z-index: 0;
position: relative;
2019-09-25 14:24:53 +08:00
overflow: hidden;
border-radius: 6px;
@include e(item-wrapper) {
position: relative;
width: 100%;
}
/** transition of menu light bar */
.n-base-select-menu__light-bar--transition-enter-active {
transition: opacity .15s $fast-in-cubic-bezier, top .3s $default-cubic-bezier!important;
}
.n-base-select-menu__light-bar--transition-leave-active {
transition: opacity .15s $slow-out-cubic-bezier, top .3s $default-cubic-bezier!important;
}
.n-base-select-menu__light-bar--transition-enter, .n-base-select-menu__light-bar--transition-leave-to {
opacity: 0;
}
2019-09-25 14:24:53 +08:00
}
background-color: $base-select-menu-background-color;
box-shadow: 0px 2px 20px 0px rgba(0,0,0,0.16);
@include e(item) {
cursor: pointer;
position: relative;
padding: 0px 14px;
white-space: nowrap;
color: map-get($map: $base-select-menu-item-color, $key: "default");
@include m(disabled) {
color: rgba(255, 255, 255, .3)!important;
&::after {
2019-09-25 14:24:53 +08:00
display: none;
}
2019-09-25 14:24:53 +08:00
@include m(selected) {
color: rgba(99, 226, 183, .3)!important;
&::after {
border-right: 1px solid rgba(99, 226, 183, .3);
border-bottom: 1px solid rgba(99, 226, 183, .3);
display: block;
}
}
cursor: not-allowed;
}
2019-09-25 14:24:53 +08:00
@include m(selected) {
color: #63E2B7FF;
}
2019-09-25 14:24:53 +08:00
@include m(no-data) {
color: rgba(255, 255, 255, .5);
text-align: center;
pointer-events: none;
}
@include m(not-found) {
color: rgba(255, 255, 255, .5);
text-align: center;
pointer-events: none;
}
@include m(loading) {
color: rgba(255, 255, 255, .5);
text-align: center;
pointer-events: none;
}
}
@include e(light-bar) {
position: absolute;
width:100%;
background-color: $select-item-background-color--active;
top: 0;
left: 0;
transition: top .15s $default-cubic-bezier;
}
@include m(multiple) {
@include e(item) {
position: relative;
transition: color .3s $default-cubic-bezier;
padding-right: 28px;
&::after {
content: '';
height: 6px;
width: 3px;
border-right: 1px solid #63E2B7FF;
border-bottom: 1px solid #63E2B7FF;
position: absolute;
right: 14px;
transform: rotate(45deg) scale(.5);
top: calc(50% - 4px);
opacity: 0;
transition: transform .3s $default-cubic-bezier, opacity .3s $default-cubic-bezier;
}
@include m(selected) {
background: none;
&::after {
opacity: 1;
transform: rotate(45deg) scale(1);
}
}
&:active {
color: #63E2B7FF;
}
}
}
}
}