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

239 lines
5.4 KiB
Plaintext
Raw Normal View History

2018-12-07 16:17:45 +08:00
@import '../../style/themes/default';
@import '../../style/mixins/index';
@import '../../checkbox/style/mixin';
@import './mixin';
@import './directory';
2018-12-07 16:17:45 +08:00
@tree-prefix-cls: ~'@{ant-prefix}-tree';
@tree-showline-icon-color: @text-color-secondary;
2018-12-07 16:17:45 +08:00
.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;
2018-12-07 16:17:45 +08:00
ol,
ul {
margin: 0;
padding: 0;
list-style: none;
}
2015-08-03 16:07:21 +08:00
li {
margin: 0;
padding: 4px 0;
2015-08-16 20:04:42 +08:00
white-space: nowrap;
list-style: none;
2015-08-16 20:04:42 +08:00
outline: 0;
2017-04-27 15:25:08 +08:00
span[draggable],
2018-12-07 16:17:45 +08:00
span[draggable='true'] {
line-height: @tree-title-height - 4px;
border-top: 2px transparent solid;
border-bottom: 2px transparent solid;
user-select: none;
2016-01-07 19:05:55 +08:00
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;
}
&.drag-over {
2017-04-27 15:25:08 +08:00
> span[draggable] {
2016-01-07 19:05:55 +08:00
color: white;
background-color: @primary-color;
2016-01-07 19:05:55 +08:00
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 {
position: absolute;
left: 0;
display: inline-block;
width: 24px;
height: 24px;
color: @primary-color;
font-size: 14px;
transform: none;
2018-09-01 20:11:13 +08:00
svg {
2018-08-17 16:36:33 +08:00
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;
height: @tree-title-height;
2015-08-16 20:04:42 +08:00
margin: 0;
padding: 0 5px;
color: @text-color;
line-height: @tree-title-height;
2015-08-16 20:04:42 +08:00
text-decoration: none;
vertical-align: top;
border-radius: @border-radius-sm;
cursor: pointer;
2018-12-07 16:17:45 +08:00
transition: all 0.3s;
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 {
display: inline-block;
width: 24px;
height: 24px;
margin: 0;
line-height: @tree-title-height;
text-align: center;
vertical-align: top;
2015-08-16 20:04:42 +08:00
border: 0 none;
outline: none;
cursor: pointer;
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 {
2018-08-25 15:51:07 +08:00
svg {
transform: rotate(-90deg);
}
2017-03-28 17:51:45 +08:00
}
}
}
}
&: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 {
color: @tree-showline-icon-color;
background: @component-background;
&.@{tree-prefix-cls}-switcher-noop {
2018-12-07 16:17:45 +08:00
.antTreeShowLineIcon('tree-doc-icon');
2017-03-28 17:51:45 +08:00
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_open {
2018-12-07 16:17:45 +08:00
.antTreeShowLineIcon('tree-showline-open-icon');
2017-03-28 17:51:45 +08:00
}
2017-07-28 11:38:39 +08:00
&.@{tree-prefix-cls}-switcher_close {
2018-12-07 16:17:45 +08:00
.antTreeShowLineIcon('tree-showline-close-icon');
}
}
}
}
li:not(:last-child)::before {
position: absolute;
left: 12px;
width: 1px;
height: 100%;
2017-09-21 18:15:10 +08:00
margin: 22px 0;
border-left: 1px solid @border-color-base;
content: ' ';
}
}
&.@{tree-prefix-cls}-icon-hide {
.@{tree-prefix-cls}-treenode-loading {
.@{tree-prefix-cls}-iconEle {
display: none;
}
}
}
2015-08-10 20:23:18 +08:00
}