naive-ui/styles/Tree.scss

115 lines
2.8 KiB
SCSS
Raw Normal View History

2019-09-05 18:06:01 +08:00
@import './mixins/mixins.scss';
@import './themes/vars.scss';
2019-09-05 18:06:01 +08:00
// 0.55 * 0.7
2019-09-15 10:45:34 +08:00
$tree-content-hover-background-color: main-color-with-alpha(.45);
$tree-content-active-background-color: main-color-with-alpha(.3);
$tree-content-selected-background-color: main-color-with-alpha(.3);
2019-09-12 11:58:46 +08:00
@include b(tree) {
2019-09-15 10:45:34 +08:00
font-size: 14px;
2019-09-12 11:58:46 +08:00
ul, li {
margin: 0;
padding: 0;
list-style: none;
}
@include b(tree-children-wrapper) {
@include fade-in-height-expand-transition(fade-in-height-expand, .15s);
2019-09-12 11:58:46 +08:00
margin-left: 16px;
}
@include b(tree-node) {
padding: 3px 0 3px 0;
&:first-child {
padding-top: 6px;
}
2019-09-13 22:32:15 +08:00
&:last-child {
padding-bottom: 0;
}
}
@include b(tree-node-switcher) {
cursor: pointer;
display: inline-flex;
height: 24px;
width: 24px;
vertical-align: bottom;
align-items: center;
justify-content: center;
svg {
width: 12px;
height: 12px;
transition: transform .15s $--n-ease-in-out-cubic-bezier;
2019-09-13 22:32:15 +08:00
}
@include m(hide) {
visibility: hidden
}
2019-09-15 10:45:34 +08:00
@include m(expanded) {
2019-09-13 22:32:15 +08:00
svg {
transform: rotate(90deg);
}
}
}
@include b(tree-node-checkbox) {
display: inline-flex;
height: 24px;
width: 16px;
vertical-align: bottom;
align-items: center;
justify-content: center;
margin-right: 4px;
}
@include b(tree-node-content) {
2019-09-15 10:45:34 +08:00
position: relative;
2019-09-13 22:32:15 +08:00
display: inline-flex;
height: 24px;
2019-09-15 10:45:34 +08:00
box-sizing: border-box;
border-bottom: 3px solid transparent;
border-top: 3px solid transparent;
line-height: 24px;
2019-09-13 22:32:15 +08:00
align-items: center;
vertical-align: bottom;
padding: 0 6px;
cursor: pointer;
2019-09-15 10:45:34 +08:00
border-radius: 3px;
transition: .2s background-color $--n-ease-in-out-cubic-bezier, .2s border-color $--n-ease-in-out-cubic-bezier;
&:hover {
background-color: $tree-content-hover-background-color;
}
2019-09-15 10:45:34 +08:00
&:active {
background-color: $tree-content-active-background-color;
}
&:last-child {
margin-bottom: 0;
}
@include e(padding-box) {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
}
2019-09-15 10:45:34 +08:00
@include m(block) {
2019-09-15 12:19:29 +08:00
width: calc(100% - 24px);
@include m(checkable) {
width: calc(100% - 48px);
}
2019-09-15 10:45:34 +08:00
}
2019-09-13 22:32:15 +08:00
@include m(pending) {
&:hover {
background-color: transparent;
}
2019-09-15 10:45:34 +08:00
@include m(pending-bottom) {
border-bottom: 3px solid $tree-content-hover-background-color;
}
@include m(pending-top) {
border-top: 3px solid $tree-content-hover-background-color;
}
@include m(pending-body) {
background-color: $tree-content-hover-background-color;
}
2019-09-13 22:32:15 +08:00
}
@include m(selected) {
background-color: $tree-content-selected-background-color;
}
2019-09-12 11:58:46 +08:00
}
2019-09-05 18:06:01 +08:00
}