naive-ui/styles/BaseSelectMenu.scss

146 lines
4.9 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-11-14 11:57:37 +08:00
@include b(base-select-option) {
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);
}
@include b(base-select-menu-light-bar) {
2019-09-25 14:24:53 +08:00
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");
@include base-select-size-mixin("huge");
2019-09-25 14:24:53 +08:00
outline: none;
margin-top: 4px;
margin-bottom: 4px;
z-index: 0;
position: relative;
2019-09-25 14:24:53 +08:00
border-radius: 6px;
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
@include b(base-select-menu-option-wrapper) {
2019-09-25 14:24:53 +08:00
position: relative;
width: 100%;
}
@include b(base-select-menu-light-bar-wrapper) {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
border-radius: 6px;
}
2019-09-25 14:24:53 +08:00
/** transition of menu light bar */
.n-base-select-menu-light-bar--transition-enter-active {
transition: opacity .15s $fast-in-cubic-bezier, top .3s $--n-ease-in-out-cubic-bezier!important;
2019-09-25 14:24:53 +08:00
}
.n-base-select-menu-light-bar--transition-leave-active {
transition: opacity .15s $slow-out-cubic-bezier, top .3s $--n-ease-in-out-cubic-bezier!important;
2019-09-25 14:24:53 +08:00
}
.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
}
2019-09-27 16:02:20 +08:00
background-color: $--base-select-menu-background-color;
2019-10-17 22:16:30 +08:00
box-shadow: $--base-select-menu-box-shadow;
2019-11-14 11:57:37 +08:00
@include b(base-select-option) {
2019-09-25 14:24:53 +08:00
cursor: pointer;
position: relative;
padding: 0px 14px;
white-space: nowrap;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "default");
@include m(selected) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "selected");
}
2019-09-25 14:24:53 +08:00
@include m(disabled) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "disabled");
&::after {
2019-09-25 14:24:53 +08:00
display: none;
}
2019-09-25 14:24:53 +08:00
@include m(selected) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "disabled-selected");
2019-09-25 14:24:53 +08:00
&::after {
2019-11-14 11:57:37 +08:00
border-right: 1px solid map-get($map: $--base-select-menu-option-color, $key: "disabled-selected");
border-bottom: 1px solid map-get($map: $--base-select-menu-option-color, $key: "disabled-selected");
2019-09-25 14:24:53 +08:00
display: block;
}
}
cursor: not-allowed;
}
2019-09-25 14:24:53 +08:00
@include m(no-data) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "disabled");
2019-09-25 14:24:53 +08:00
text-align: center;
pointer-events: none;
}
@include m(not-found) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "disabled");
2019-09-25 14:24:53 +08:00
text-align: center;
pointer-events: none;
}
@include m(loading) {
2019-11-14 11:57:37 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "disabled");
2019-09-25 14:24:53 +08:00
text-align: center;
pointer-events: none;
}
}
@include b(base-select-menu-light-bar) {
2019-12-23 21:40:45 +08:00
transition: background-color .3s $--n-ease-in-out-cubic-bezier, top .15s $--n-ease-in-out-cubic-bezier;
2019-09-25 14:24:53 +08:00
position: absolute;
width:100%;
2019-09-27 16:02:20 +08:00
background-color: $--base-select-menu-light-bar-background-color;
2019-09-25 14:24:53 +08:00
top: 0;
left: 0;
}
@include m(multiple) {
2019-11-14 11:57:37 +08:00
@include b(base-select-option) {
2019-09-25 14:24:53 +08:00
position: relative;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-09-25 14:24:53 +08:00
padding-right: 28px;
&::after {
2019-09-27 16:02:20 +08:00
@include once {
content: '';
height: 6px;
width: 3px;
position: absolute;
right: 14px;
transform: rotate(45deg) scale(.5);
top: calc(50% - 4px);
opacity: 0;
transition: transform .3s $--n-ease-in-out-cubic-bezier, opacity .3s $--n-ease-in-out-cubic-bezier;
2019-09-27 16:02:20 +08:00
}
2019-12-04 18:43:55 +08:00
border-right: 1px solid $--base-select-menu-option-check-mark-color;
border-bottom: 1px solid $--base-select-menu-option-check-mark-color;
2019-09-25 14:24:53 +08:00
}
@include m(selected) {
background: none;
&::after {
opacity: 1;
transform: rotate(45deg) scale(1);
}
}
&:active {
2019-12-04 18:43:55 +08:00
color: map-get($map: $--base-select-menu-option-color, $key: "active");
2019-09-25 14:24:53 +08:00
}
}
}
}
}