UNPKG

4.66 kBtext/lessView Raw
1@import '../../style/themes/index';
2@import '../../style/mixins/index';
3
4//== Style for input-group: input with label, with button or dropdown...
5.@{ant-prefix}-input-group {
6 &-wrapper {
7 &-rtl {
8 direction: rtl;
9 }
10 }
11 &-rtl {
12 direction: rtl;
13 }
14}
15
16// affix
17@input-affix-margin: 4px;
18
19.@{ant-prefix}-input {
20 &-affix-wrapper&-affix-wrapper-rtl {
21 > input.@{ant-prefix}-input {
22 border: none;
23 outline: none;
24 }
25 }
26
27 &-affix-wrapper-rtl {
28 .@{ant-prefix}-input-prefix {
29 margin: 0 0 0 @input-affix-margin;
30 }
31
32 .@{ant-prefix}-input-suffix {
33 margin: 0 @input-affix-margin 0 0;
34 }
35 }
36
37 &-textarea {
38 &-rtl {
39 direction: rtl;
40 }
41
42 &-rtl&-show-count::after {
43 text-align: left;
44 }
45 }
46}
47
48// allow-clear
49.@{ant-prefix}-input-clear-icon {
50 &-has-suffix {
51 .@{ant-prefix}-input-affix-wrapper-rtl & {
52 margin-right: 0;
53 margin-left: @input-affix-margin;
54 }
55 }
56
57 .@{ant-prefix}-input-affix-wrapper-rtl & {
58 right: auto;
59 left: 8px;
60 }
61}
62
63// mixin
64@input-rtl-cls: ~'@{ant-prefix}-input-rtl';
65
66.active() {
67 .@{input-rtl-cls} & {
68 border-right-width: 0;
69 border-left-width: @border-width-base !important;
70 }
71}
72
73.hover() {
74 .@{input-rtl-cls} & {
75 border-right-width: 0;
76 border-left-width: @border-width-base !important;
77 }
78}
79
80.input() {
81 &-rtl {
82 direction: rtl;
83 }
84}
85
86// label input
87.input-group(@inputClass) {
88 > .@{inputClass}-rtl:first-child,
89 &-rtl &-addon:first-child {
90 border-radius: 0 @border-radius-base @border-radius-base 0;
91 }
92
93 &-addon:first-child {
94 .@{inputClass}-group-rtl & {
95 border-right: @border-width-base @border-style-base @input-border-color;
96 border-left: 0;
97 }
98 }
99
100 &-addon:last-child {
101 .@{inputClass}-group-rtl & {
102 border-right: 0;
103 border-left: @border-width-base @border-style-base @input-border-color;
104 }
105 }
106
107 > .@{inputClass}:last-child,
108 &-addon:last-child {
109 .@{inputClass}-group-rtl& {
110 border-radius: @border-radius-base 0 0 @border-radius-base;
111 }
112 }
113
114 .@{inputClass}-affix-wrapper {
115 &:not(:first-child) {
116 .@{inputClass}-group-rtl& {
117 border-radius: @border-radius-base 0 0 @border-radius-base;
118 }
119 }
120
121 &:not(:last-child) {
122 .@{inputClass}-group-rtl& {
123 border-radius: 0 @border-radius-base @border-radius-base 0;
124 }
125 }
126 }
127
128 &&-compact {
129 & > *:not(:last-child) {
130 .@{inputClass}-group-rtl& {
131 margin-right: 0;
132 margin-left: -@border-width-base;
133 border-left-width: @border-width-base;
134 }
135 }
136
137 & > *:first-child,
138 & > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selector,
139 & > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input,
140 & > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input {
141 .@{inputClass}-group-rtl& {
142 border-radius: 0 @border-radius-base @border-radius-base 0;
143 }
144 }
145
146 & > *:last-child,
147 & > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selector,
148 & > .@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input,
149 & > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input,
150 & > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input {
151 .@{inputClass}-group-rtl& {
152 border-left-width: @border-width-base;
153 border-radius: @border-radius-base 0 0 @border-radius-base;
154 }
155 }
156
157 .@{ant-prefix}-input-group-wrapper-rtl + .@{ant-prefix}-input-group-wrapper-rtl {
158 margin-right: -1px;
159 margin-left: 0;
160 }
161
162 .@{ant-prefix}-input-group-wrapper-rtl:not(:last-child) {
163 &.@{ant-prefix}-input-search > .@{ant-prefix}-input-group {
164 & > .@{ant-prefix}-input {
165 border-radius: 0 @border-radius-base @border-radius-base 0;
166 }
167 }
168 }
169 }
170}
171
172// search-input
173@search-prefix: ~'@{ant-prefix}-input-search';
174@search-rtl-cls: ~'@{search-prefix}-rtl';
175
176.@{search-prefix}-rtl {
177 direction: rtl;
178
179 .@{ant-prefix}-input {
180 &:hover,
181 &:focus {
182 + .@{ant-prefix}-input-group-addon .@{search-prefix}-button:not(.@{ant-prefix}-btn-primary) {
183 border-right-color: @input-hover-border-color;
184 border-left-color: @border-color-base;
185 }
186 }
187 }
188
189 > .@{ant-prefix}-input-group {
190 > .@{ant-prefix}-input-affix-wrapper {
191 &:hover,
192 &-focused {
193 border-right-color: @input-hover-border-color;
194 }
195 }
196
197 > .@{ant-prefix}-input-group-addon {
198 right: -1px;
199 left: auto;
200 .@{search-prefix}-button {
201 border-radius: @border-radius-base 0 0 @border-radius-base;
202 }
203 }
204 }
205}