| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- @import '~ant-design-vue/es/style/themes/index';
- @import '~ant-design-vue/es/style/mixins/index';
- @import '~ant-design-vue/es/checkbox/style/mixin';
- @import './mixin';
- @import './directory';
- @tree-prefix-cls : ~'@{ant-prefix}-tree';
- @tree-showline-icon-color: @text-color-secondary;
- @tree-node-padding : 4px;
- .antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-tree-checkbox');
- .@{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;
- margin : 0;
- padding: 0;
- ol,
- ul {
- margin : 0;
- padding : 0;
- list-style: none;
- }
- li {
- margin : 0;
- padding : @tree-node-padding 0;
- white-space: nowrap;
- list-style : none;
- outline : 0;
- span[draggable],
- span[draggable='true'] {
- line-height : @tree-title-height - 4px;
- border-top : 2px transparent solid;
- border-bottom : 2px transparent solid;
- user-select : none;
- /* Required to make elements draggable in old WebKit */
- -khtml-user-drag : element;
- -webkit-user-drag: element;
- }
- &.drag-over {
- >span[draggable] {
- color : white;
- background-color: @primary-color;
- opacity : 0.8;
- }
- }
- &.drag-over-gap-top {
- >span[draggable] {
- border-top-color: @primary-color;
- }
- }
- &.drag-over-gap-bottom {
- >span[draggable] {
- border-bottom-color: @primary-color;
- }
- }
- &.filter-node {
- >span {
- color : @highlight-color !important;
- font-weight: 500 !important;
- }
- }
- // When node is loading
- &.@{tree-prefix-cls}-treenode-loading {
- span {
- &.@{tree-prefix-cls}-switcher {
- &.@{tree-prefix-cls}-switcher_open,
- &.@{tree-prefix-cls}-switcher_close {
- .@{tree-prefix-cls}-switcher-loading-icon {
- position : absolute;
- left : 0;
- display : inline-block;
- width : 24px;
- height : @tree-title-height;
- color : @primary-color;
- font-size: @font-size-base;
- transform: none;
- svg {
- position: absolute;
- top : 0;
- right : 0;
- bottom : 0;
- left : 0;
- margin : auto;
- }
- }
- :root &::after {
- opacity: 0;
- }
- }
- }
- }
- }
- ul {
- margin : 0;
- padding: 0 0 0 @tree-child-padding;
- }
- .@{tree-prefix-cls}-node-content-wrapper {
- display : inline-block;
- height : @tree-title-height;
- margin : 0;
- padding : 0 5px;
- color : @text-color;
- line-height : @tree-title-height;
- text-decoration: none;
- vertical-align : top;
- border-radius : @border-radius-sm;
- cursor : pointer;
- transition : all 0.3s;
- &:hover {
- background-color: @tree-node-hover-bg;
- }
- &.@{tree-prefix-cls}-node-selected {
- background-color: @tree-node-selected-bg;
- }
- }
- span {
- &.@{tree-prefix-cls}-checkbox {
- top : initial;
- height : @tree-title-height;
- margin : 0 4px 0 2px;
- padding: ((@tree-title-height - 16px) / 2) 0;
- }
- &.@{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;
- border : 0 none;
- outline : none;
- cursor : pointer;
- }
- &.@{tree-prefix-cls}-iconEle:empty {
- display: none;
- }
- &.@{tree-prefix-cls}-switcher {
- position: relative;
- &.@{tree-prefix-cls}-switcher-noop {
- cursor: default;
- }
- &.@{tree-prefix-cls}-switcher_open {
- .antTreeSwitcherIcon();
- }
- &.@{tree-prefix-cls}-switcher_close {
- .antTreeSwitcherIcon();
- .@{tree-prefix-cls}-switcher-icon {
- svg {
- transform: rotate(-90deg);
- }
- }
- }
- }
- }
- &:last-child>span {
- &.@{tree-prefix-cls}-switcher,
- &.@{tree-prefix-cls}-iconEle {
- &::before {
- display: none;
- }
- }
- }
- }
- >li {
- &:first-child {
- padding-top: 7px;
- }
- &:last-child {
- padding-bottom: 7px;
- }
- }
- &-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;
- }
- }
- }
- li&-treenode-disabled {
- >span:not(.@{tree-prefix-cls}-switcher),
- >.@{tree-prefix-cls}-node-content-wrapper,
- >.@{tree-prefix-cls}-node-content-wrapper span {
- color : @disabled-color;
- cursor: not-allowed;
- }
- >.@{tree-prefix-cls}-node-content-wrapper:hover {
- background: transparent;
- }
- }
- &-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 {
- .antTreeShowLineIcon('tree-doc-icon');
- }
- &.@{tree-prefix-cls}-switcher_open {
- .antTreeShowLineIcon('tree-showline-open-icon');
- }
- &.@{tree-prefix-cls}-switcher_close {
- .antTreeShowLineIcon('tree-showline-close-icon');
- }
- }
- }
- }
- li:not(:last-child)::before {
- position : absolute;
- left : 12px;
- width : 1px;
- height : 100%;
- 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)';
- }
- }
- }
- }
- }
- }
|