ant-design/components/tree/style/index.less

237 lines
5.4 KiB
Plaintext
Raw Normal View History

@import "../../style/themes/default";
@import "../../style/mixins/index";
@import "../../checkbox/style/mixin";
@import "./mixin";
@import "./directory";
@tree-prefix-cls: ~"@{ant-prefix}-tree";
@tree-showline-icon-color: @text-color-secondary;
.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-tree-checkbox");
2015-08-20 16:55:42 +08:00
.@{tree-prefix-cls} {
.reset-component;
2015-08-16 20:04:42 +08:00
margin: 0;
2017-07-20 17:17:56 +08:00
padding: 0;
ol, ul {
list-style: none;
margin: 0;
padding: 0;
}
2015-08-03 16:07:21 +08:00
li {
2017-02-25 19:17:54 +08:00
padding: 4px 0;
margin: 0;
2015-08-16 20:04:42 +08:00
list-style: none;
white-space: nowrap;
outline: 0;
2017-04-27 15:25:08 +08:00
span[draggable],
span[draggable="true"] {
2016-01-07 19:05:55 +08:00
user-select: none;
border-top: 2px transparent solid;
border-bottom: 2px transparent solid;
2016-01-07 19:05:55 +08:00
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;
line-height: @tree-title-height - 4px;
2016-01-07 19:05:55 +08:00
}
&.drag-over {
2017-04-27 15:25:08 +08:00
> span[draggable] {
2016-01-28 15:29:29 +08:00
background-color: @primary-color;
2016-01-07 19:05:55 +08:00
color: white;
opacity: 0.8;
}
}
&.drag-over-gap-top {
2017-04-27 15:25:08 +08:00
> span[draggable] {
border-top-color: @primary-color;
2016-01-07 19:05:55 +08:00
}
}
&.drag-over-gap-bottom {
2017-04-27 15:25:08 +08:00
> span[draggable] {
border-bottom-color: @primary-color;
2016-01-07 19:05:55 +08:00
}
}
&.filter-node {
2017-04-27 15:25:08 +08:00
> span {
2017-08-04 17:58:32 +08:00
color: @highlight-color !important;
2017-08-17 22:10:40 +08:00
font-weight: 500 !important;
2016-01-07 19:05:55 +08:00
}
}
// When node is loading
&.@{tree-prefix-cls}-treenode-loading {
span {
&.@{tree-prefix-cls}-switcher {
&.@{tree-prefix-cls}-switcher_open,
&.@{tree-prefix-cls}-switcher_close {
2018-08-17 16:36:33 +08:00
.@{tree-prefix-cls}-switcher-loading-icon {
display: inline-block;
position: absolute;
left: 0;
width: 24px;
height: 24px;
color: @primary-color;
transform: none;
font-size: 14px;
2018-08-17 16:36:33 +08:00
&-svg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
}
}
:root &:after {
opacity: 0;
}
}
}
}
}
2015-08-10 20:23:18 +08:00
ul {
2015-08-16 20:04:42 +08:00
margin: 0;
padding: 0 0 0 @tree-child-padding;
2015-08-03 16:07:21 +08:00
}
2017-04-27 15:25:08 +08:00
.@{tree-prefix-cls}-node-content-wrapper {
2015-08-10 20:23:18 +08:00
display: inline-block;
2017-09-21 18:12:53 +08:00
padding: 0 5px;
border-radius: @border-radius-sm;
2015-08-16 20:04:42 +08:00
margin: 0;
cursor: pointer;
text-decoration: none;
vertical-align: top;
2016-11-08 20:50:59 +08:00
color: @text-color;
transition: all .3s;
height: @tree-title-height;
line-height: @tree-title-height;
2016-01-30 16:53:49 +08:00
&:hover {
background-color: @item-hover-bg;
2016-01-30 16:53:49 +08:00
}
&.@{tree-prefix-cls}-node-selected {
background-color: @primary-2;
2016-01-30 16:53:49 +08:00
}
2015-08-03 16:07:21 +08:00
}
2015-08-10 20:23:18 +08:00
span {
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-checkbox {
margin: 4px 4px 0 2px;
2015-08-19 12:18:10 +08:00
}
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-switcher,
&.@{tree-prefix-cls}-iconEle {
2015-08-16 20:04:42 +08:00
margin: 0;
width: 24px;
height: 24px;
line-height: @tree-title-height;
2015-08-16 20:04:42 +08:00
display: inline-block;
vertical-align: top;
2015-08-16 20:04:42 +08:00
border: 0 none;
cursor: pointer;
outline: none;
text-align: center;
2015-08-16 20:04:42 +08:00
}
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-switcher {
position: relative;
2016-08-17 17:12:40 +08:00
&.@{tree-prefix-cls}-switcher-noop {
cursor: default;
2016-08-17 17:12:40 +08:00
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_open {
2017-03-28 17:51:45 +08:00
.antTreeSwitcherIcon();
2015-08-16 20:04:42 +08:00
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_close {
2017-03-28 17:51:45 +08:00
.antTreeSwitcherIcon();
2018-08-17 16:04:11 +08:00
.@{tree-prefix-cls}-switcher-icon {
2017-03-28 17:51:45 +08:00
transform: rotate(270deg) scale(0.59);
}
}
}
}
&:last-child > span {
&.@{tree-prefix-cls}-switcher,
&.@{tree-prefix-cls}-iconEle {
&:before {
display: none;
2015-08-10 20:23:18 +08:00
}
}
2015-08-03 16:07:21 +08:00
}
2015-08-10 20:23:18 +08:00
}
> li {
&:first-child {
padding-top: 7px;
}
&:last-child {
padding-bottom: 7px;
}
}
2015-08-24 18:12:07 +08:00
&-child-tree {
display: none;
&-open {
display: block;
}
}
li&-treenode-disabled {
> span:not(.@{tree-prefix-cls}-switcher),
2017-04-27 15:25:08 +08:00
> .@{tree-prefix-cls}-node-content-wrapper,
> .@{tree-prefix-cls}-node-content-wrapper span {
color: @disabled-color;
2016-01-07 19:05:55 +08:00
cursor: not-allowed;
2015-08-03 16:07:21 +08:00
}
> .@{tree-prefix-cls}-node-content-wrapper:hover {
background: transparent;
}
2015-08-03 16:07:21 +08:00
}
&-icon__open {
margin-right: 2px;
vertical-align: top;
}
&-icon__close {
margin-right: 2px;
vertical-align: top;
}
// Tree with line
&&-show-line {
li {
position: relative;
span {
&.@{tree-prefix-cls}-switcher {
background: @component-background;
color: @tree-showline-icon-color;
&.@{tree-prefix-cls}-switcher-noop {
2017-03-28 17:51:45 +08:00
.antTreeShowLineIcon("tree-doc-icon");
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_open {
2017-03-28 17:51:45 +08:00
.antTreeShowLineIcon("tree-showline-open-icon");
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_close {
2017-03-28 17:51:45 +08:00
.antTreeShowLineIcon("tree-showline-close-icon");
}
}
}
}
li:not(:last-child):before {
content: ' ';
width: 1px;
border-left: 1px solid @border-color-base;
height: 100%;
position: absolute;
left: 12px;
2017-09-21 18:15:10 +08:00
margin: 22px 0;
}
}
&.@{tree-prefix-cls}-icon-hide {
.@{tree-prefix-cls}-treenode-loading {
.@{tree-prefix-cls}-iconEle {
display: none;
}
}
}
2015-08-10 20:23:18 +08:00
}