-
Notifications
You must be signed in to change notification settings - Fork 312
/
_index.less
165 lines (133 loc) · 3.07 KB
/
_index.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// 组件允许单个组件打包,因此默认引入公共基础样式
@import "../../base.less";
@import "./_var.less";
@import "./_mixin.less";
@import "../../mixins/_reset.less";
.@{prefix}-form {
.reset;
font: @form-font;
&:not(.@{prefix}-form-inline) {
.@{prefix}-form__item {
&:last-of-type {
margin: 0;
}
}
}
&__item {
margin-bottom: @form-item-margin-bottom;
// 文档流撑开内容补足剩余的 4px
&.@{prefix}-form__item-with-help {
margin-bottom: @form-item-with-help-margin-bottom;
}
// 绝对定位布局需要重设底部间距
&.@{prefix}-form__item-with-extra {
margin-bottom: @form-item-margin-bottom;
}
}
&__label {
float: left;
padding-right: @form-label-padding-right;
vertical-align: middle;
line-height: @form-item-control-height;
color: @form-color-label;
box-sizing: border-box;
white-space: nowrap;
&--top {
float: none;
min-height: @form-item-control-height;
}
&--left {
text-align: left;
}
&--right {
text-align: right;
}
&--required {
label::before {
display: inline-block;
margin-right: @form-label-margin-right-required;
color: @form-color-error;
line-height: @form-label-line-height;
content: "*";
}
}
&--colon {
label::after {
content: ":";
position: relative;
margin: @form-label-margin-colon;
}
}
}
&__controls {
min-height: @form-item-control-height;
display: flow-root;
position: relative;
&-content {
display: flex;
align-items: center;
min-height: @form-item-control-height;
}
// formItem 嵌套情况无间距
.@{prefix}-form__item {
margin-bottom: 0;
margin-right: @form-item-margin-right-inline;
}
}
&__controls.@{prefix}-is-success {
.input-status-icon(success);
.input-status-extra(success);
}
&__controls.@{prefix}-form--success-border {
// 输入框状态
.input-status(success);
}
&__status {
display: flex;
margin: @form-status-margin;
> .t-icon {
font-size: @form-status-icon-size;
}
&-without-icon {
width: 25px;
height: 25px;
}
button {
width: @form-status-button-width;
}
button + button {
margin-left: @form-status-button-margin;
}
}
}
.@{prefix}-form-inline {
display: flex;
flex-wrap: wrap;
row-gap: @form-item-row-gap;
.@{prefix}-form__item {
margin: 0;
min-width: 200px;
display: inline-block;
margin-right: @form-item-margin-right-inline;
}
}
.@{prefix}-input__extra,
.@{prefix}-input__help {
margin: 0;
width: 100%;
height: auto;
min-height: @form-item-help-line-height;
font: @form-item-help-font;
color: @form-color-extra;
}
.@{prefix}-input__extra {
position: absolute;
bottom: calc(0px - @form-item-help-line-height);
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// 输入框状态
.input-status(warning);
.input-status(error);