UNPKG

4.98 kBSCSSView Raw
1////
2/// @module tree: 树
3/// @tag Tree
4/// @category component
5/// @family data-display
6/// @varPrefix $tree-
7/// @classPrefix {prefix}-tree
8/// @order {"size/node":10,"size/label":11,"size/arrow":12,"size/switch":13,"size/arrow & switch":14,"size/line":15,"statement/normal":10,"statement/normal/label":100,"statement/normal/arrow":101,"statement/normal/switch":102,"statement/normal/line":103,"statement/hover":11,"statement/hover/label":110,"statement/hover/arrow":111,"statement/hover/switch":112,"statement/selected":12,"statement/selected/label":120,"statement/disabled":13,"statement/disabled/label":130}
9////
10
11$tree-prefix: '.' + $css-prefix + 'tree';
12
13// Size
14// ----------------------------------------
15
16/// padding (t, b)
17/// @namespace size/node
18$tree-node-padding: $s-1 !default;
19
20/// margin (l, r)
21/// @namespace size/label
22$tree-node-title-margin: $s-1 !default;
23
24/// padding (l, r)
25/// @namespace size/label
26$tree-node-title-padding: $s-1 !default;
27
28/// text
29/// @namespace size/label
30$tree-node-title-font-size: $font-size-body-1 !default;
31
32/// size
33/// @namespace size/arrow
34$tree-switch-arrow-size: $icon-xs !default;
35
36/// size
37/// @namespace size/switch
38$tree-switch-size: $s-4 !default;
39
40/// icon
41/// @namespace size/switch
42$tree-switch-icon-size: $icon-xxs !default;
43
44/// border width
45/// @namespace size/switch
46$tree-switch-border-width: $line-1 !default;
47
48/// margin (r)
49/// @namespace size/arrow & switch
50$tree-switch-margint-right: $s-2 !default;
51
52/// width
53/// @namespace size/line
54$tree-line-width: $line-1 !default;
55
56// Statement:Normal
57// ----------------------------------------
58
59/// text
60/// @namespace statement/normal/label
61$tree-node-normal-color: $color-text1-4 !default;
62
63/// background
64/// @namespace statement/normal/label
65$tree-node-normal-background: $color-white !default;
66
67/// corner
68/// @namespace statement/normal/label
69$tree-node-title-border-radius: $corner-1 !default;
70
71/// color
72/// @namespace statement/normal/arrow
73$tree-switch-arrow-color: $color-text1-2 !default;
74
75/// fold icon
76/// @namespace statement/normal/switch
77/// @type icon
78$tree-switcher-fold-icon-content: $icon-content-add !default;
79
80/// unfold icon
81/// @namespace statement/normal/switch
82/// @type icon
83$tree-switcher-unfold-icon-content: $icon-content-minus !default;
84
85/// icon color
86/// @namespace statement/normal/switch
87$tree-switch-icon-color: $color-text1-3 !default;
88
89/// background
90/// @namespace statement/normal/switch
91$tree-switch-bg-color: $color-white !default;
92
93/// border color
94/// @namespace statement/normal/switch
95$tree-switch-border-color: $color-line1-3 !default;
96
97/// corner
98/// @namespace statement/normal/switch
99$tree-switch-corner: $corner-1 !default;
100
101/// color
102/// @namespace statement/normal/line
103$tree-line-color: $color-line1-3 !default;
104
105/// style
106/// @namespace statement/normal/line
107$tree-line-style: $line-solid !default;
108
109// Statement:Hover
110// ----------------------------------------
111
112/// text
113/// @namespace statement/hover/label
114$tree-node-hover-color: $color-text1-4 !default;
115
116/// background
117/// @namespace statement/hover/label
118$tree-node-hover-bg-color: $color-fill1-2 !default;
119
120/// color
121/// @namespace statement/hover/arrow
122$tree-switch-hover-arrow-color: $color-text1-4 !default;
123
124/// icon color
125/// @namespace statement/hover/switch
126$tree-switch-hover-icon-color: $color-text1-4 !default;
127
128/// background
129/// @namespace statement/hover/switch
130$tree-switch-hover-bg-color: $color-fill1-2 !default;
131
132/// border color
133/// @namespace statement/hover/switch
134$tree-switch-hover-border-color: $color-line1-4 !default;
135
136// Statement:Selected
137// ----------------------------------------
138
139/// text
140/// @namespace statement/selected/label
141$tree-node-selected-color: $color-text1-4 !default;
142
143/// background
144/// @namespace statement/selected/label
145$tree-node-selected-background: $color-brand1-1 !default;
146
147// Statement:Disabled
148// ----------------------------------------
149
150/// text
151/// @namespace statement/disabled/label
152$tree-node-disabled-color: $color-text1-1 !default;
153
154/// background
155/// @namespace statement/disabled/label
156$tree-node-disabled-background: $color-white !default;
157
158$tree-child-indent: $s-6 !default;
159$tree-node-title-height: $s-5 !default;
160$tree-child-indent-left: calc((#{$tree-switch-size} - #{$tree-line-width}) / 2);
161$tree-child-indent-right: calc(#{$tree-child-indent} - #{$tree-line-width} - (#{$tree-switch-size} - #{$tree-line-width}) / 2);
162$tree-child-right-angle-left: calc(0px - (#{$tree-child-indent} - (#{$tree-switch-size} - #{$tree-line-width}) / 2 + #{$tree-switch-border-width}));
163$tree-child-right-angle-width: calc(#{$tree-child-indent} - (#{$tree-switch-size} - #{$tree-line-width}) / 2);
164
165$tree-line: $tree-line-width $tree-line-style $tree-line-color;
166
167
168/// fold icon
169/// @namespace statement/normal
170/// @type icon
171$tree-fold-icon-content: $icon-content-arrow-down !default;
172
173/// unfold icon
174/// @namespace statement/normal
175/// @type icon
176$tree-unfold-icon-content: $icon-reset !default;