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

277 lines
6.5 KiB
Plaintext
Raw Normal View History

meger feature to master (#16421) * use ul in list * update snapshot * update comment * feat: TreeSelect support `showSearch` in multiple mode (#15933) * update rc-tree-select * typo * update desc & snapshot * update desc & snapshot * check default showSearch * feat: table customizing variable (#15971) * feat: added table selected row color variable * fix: @table-selected-row-color default is inherit * feat: Upload support customize previewFile (#15984) * support preview file * use promise * dealy load * use canvas of render * use domHook of test * update demo * add snapshot * update types * update testcase * feat: form customizing variables (#15954) * fix: added styling form input background-color * feat: added '@form-warning-input-bg' variable * feat: added '@form-error-input-bg' variable * use li wrap with comment * feat: Support append theme less file with less-variable (#16118) * add override * add override support * update doc * feat: dropdown support set right icon * docs: update doc of dropdown component * style: format dropdown-button.md * test: update updateSnapshot * style: format dropdown-button.md * test: update updateSnapshot * test: update updateSnapshot * style: change style of dropdown-button demo * fix: fix document table order * feat: Support SkeletonAvatarProps.size accept number (#16078) (#16128) * chore:update style of demo * feat: Notification functions accept top, bottom and getContainer as arguments * drawer: add afterVisibleChange * rm onVisibleChange * update * feat: 🇭🇷 hr_HR locale (#16258) * Added Croatian locale * fixed lint error * :white_check_mark: Add test cases for hr_HR * :memo: update i18n documentation * feat: add `htmlFor` in Form.Item (#16278) * add htmlFor in Form.Item * update doc * feat: Button support `link` type (#16289) close #15892 * feat: Add Timeline.Item.position (#16148) (#16193) * fix: Timeline.pendingDot interface documentation there is a small problem (#16177) * feat: Add Timeline.Item.position (#16148) * doc: add version infomation for Timeline.Item.position * refactor: Update Tree & TreeSelect deps (#16330) * use CSSMotion * update snapshot * feat: Collapse support `expandIconPosition` (#16365) * update doc * support expandIconPosition * update snapshot * feat: Breadcrumb support DropDown (#16315) * breadcrumbs support drop down menu * update doc * add require less * fix test * fix md doc * less code * fix style warning * update snap * add children render test * feat: TreeNode support checkable * feat: add optional to support top and left slick dots (#16186) (#16225) * add optional to support top and left slick dots * update carousel snapshot * Update doc, add placement demo * update carousel placement demo snapshots * rename dots placement to position * update vertical as deprecated * rename dotsPosition to dotPosition * refine code * add warning testcase for vertical * remove unused warning * update expression * Additional test case for dotPosition * refactor: Upgrade `rc-tree-select` to support pure React motion (#16402) * upgrade `rc-tree-select` * update snapshot * 3.17.0 changelog * fix warning * fix review warning
2019-05-06 12:04:39 +08:00
@import '../../style/themes/index';
2018-12-07 16:17:45 +08:00
@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;
@tree-node-padding: 4px;
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} {
/* see https://github.com/ant-design/ant-design/issues/16259 */
&-checkbox-checked::after {
position: absolute;
top: 16.67%;
left: 0;
width: 100%;
height: 66.67%;
}
.reset-component;
2019-04-15 10:52:00 +08:00
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: @tree-node-padding 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: @tree-title-height;
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: @tree-node-hover-bg;
2016-01-30 16:53:49 +08:00
}
&.@{tree-prefix-cls}-node-selected {
background-color: @tree-node-selected-bg;
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 {
top: initial;
height: @tree-title-height;
margin: 0 4px 0 2px;
padding: ((@tree-title-height - 16px) / 2) 0;
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: @tree-title-height;
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 {
// https://github.com/ant-design/ant-design/issues/14958
> li {
// Provide additional padding between top child node and parent node
&:first-child {
padding-top: 2 * @tree-node-padding;
}
// Hide additional padding between last child node and next parent node
&:last-child {
padding-bottom: 0;
}
}
2015-08-24 18:12:07 +08:00
}
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%;
2019-06-12 12:20:32 +08:00
height: calc(100% - 22px); // Remove additional height if support
margin: 22px 0 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;
}
}
}
&.@{tree-prefix-cls}-block-node {
li {
.@{tree-prefix-cls}-node-content-wrapper {
width: ~'calc(100% - 24px)';
}
span {
&.@{tree-prefix-cls}-checkbox {
+ .@{tree-prefix-cls}-node-content-wrapper {
width: ~'calc(100% - 46px)';
}
}
}
}
}
2015-08-10 20:23:18 +08:00
}