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

195 lines
4.6 KiB
Plaintext
Raw Normal View History

@import "../../style/themes/default";
@import "../../style/mixins/index";
@import "../../checkbox/style/mixin";
@import "./mixin";
@tree-prefix-cls: ~"@{ant-prefix}-tree";
.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-tree-checkbox");
2015-08-20 16:55:42 +08:00
.@{tree-prefix-cls} {
2015-08-16 20:04:42 +08:00
margin: 0;
padding: 5px;
2016-11-08 20:57:07 +08:00
font-size: @font-size-base;
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;
2016-01-07 19:05:55 +08:00
a[draggable],
a[draggable="true"] {
user-select: none;
border-top: 2px transparent solid;
border-bottom: 2px transparent solid;
margin-top: -2px;
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 {
> a[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 {
> a[draggable] {
border-top-color: @primary-color;
2016-01-07 19:05:55 +08:00
}
}
&.drag-over-gap-bottom {
> a[draggable] {
border-bottom-color: @primary-color;
2016-01-07 19:05:55 +08:00
}
}
&.filter-node {
> a {
2016-11-09 21:30:02 +08:00
color: @highlight-color!important;
2016-01-07 19:05:55 +08:00
font-weight: bold!important;
}
}
2015-08-10 20:23:18 +08:00
ul {
2015-08-16 20:04:42 +08:00
margin: 0;
padding: 0 0 0 18px;
2015-08-03 16:07:21 +08:00
}
a {
2015-08-10 20:23:18 +08:00
display: inline-block;
2016-01-28 15:29:29 +08:00
padding: 1px 5px;
2015-12-05 13:46:52 +08:00
border-radius: 2px;
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;
2016-01-30 16:53:49 +08:00
transition: all 0.3s ease;
&:hover {
background-color: @primary-1;
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 {
2017-03-28 17:51:45 +08:00
margin: 0 4px 0 2px;
vertical-align: middle;
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: 16px;
2016-01-30 16:53:49 +08:00
height: 16px;
line-height: 16px;
2015-08-16 20:04:42 +08:00
display: inline-block;
vertical-align: middle;
border: 0 none;
cursor: pointer;
outline: none;
}
2015-10-27 15:47:01 +08:00
&.@{tree-prefix-cls}-icon_loading {
&:after {
display: inline-block;
.iconfont-font("\e6ae");
2016-04-19 15:15:54 +08:00
animation: loadingCircle 1s infinite linear;
2016-07-13 16:12:44 +08:00
color: @primary-color;
2015-10-27 15:47:01 +08:00
}
}
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-switcher {
2016-08-17 17:12:40 +08:00
&.@{tree-prefix-cls}-switcher-noop {
cursor: default;
2016-08-17 17:12:40 +08:00
}
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-roots_open,
&.@{tree-prefix-cls}-center_open,
&.@{tree-prefix-cls}-bottom_open,
&.@{tree-prefix-cls}-noline_open {
2017-03-28 17:51:45 +08:00
.antTreeSwitcherIcon();
2015-08-16 20:04:42 +08:00
}
2015-08-20 16:55:42 +08:00
&.@{tree-prefix-cls}-roots_close,
&.@{tree-prefix-cls}-center_close,
&.@{tree-prefix-cls}-bottom_close,
&.@{tree-prefix-cls}-noline_close {
2017-03-28 17:51:45 +08:00
.antTreeSwitcherIcon();
.ie-rotate(3);
&:after {
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;
}
}
2015-08-10 20:23:18 +08:00
&-treenode-disabled {
2017-03-28 17:17:56 +08:00
> span,
> a,
> a span {
color: @disabled-color;
2016-01-07 19:05:55 +08:00
cursor: not-allowed;
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;
&.@{tree-prefix-cls}-switcher-noop {
2017-03-28 17:51:45 +08:00
.antTreeShowLineIcon("tree-doc-icon");
}
&.@{tree-prefix-cls}-roots_open,
&.@{tree-prefix-cls}-center_open,
&.@{tree-prefix-cls}-bottom_open,
&.@{tree-prefix-cls}-noline_open {
.antTreeShowLineIcon("tree-showline-open-icon");
}
&.@{tree-prefix-cls}-roots_close,
&.@{tree-prefix-cls}-center_close,
&.@{tree-prefix-cls}-bottom_close,
&.@{tree-prefix-cls}-noline_close {
.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: 6px;
2017-03-28 17:51:45 +08:00
margin: 18px 0;
}
}
2015-08-10 20:23:18 +08:00
}