1 |
|
2 |
|
3 |
|
4 | @import "../../common/variables";
|
5 | @import "../button/common";
|
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 | $input-button-height: $pt-button-height-small !default;
|
37 |
|
38 | $input-button-height-large: $pt-button-height !default;
|
39 |
|
40 | $input-button-height-small: $pt-button-height-smaller !default;
|
41 |
|
42 | .#{$ns}-input-group {
|
43 | display: block;
|
44 | position: relative;
|
45 |
|
46 | .#{$ns}-input {
|
47 |
|
48 | position: relative;
|
49 | width: 100%;
|
50 |
|
51 |
|
52 | &:not(:first-child) {
|
53 | padding-left: $pt-input-height;
|
54 | }
|
55 |
|
56 | &:not(:last-child) {
|
57 | padding-right: $pt-input-height;
|
58 | }
|
59 | }
|
60 |
|
61 | .#{$ns}-input-action,
|
62 | > .#{$ns}-input-left-container,
|
63 | > .#{$ns}-button,
|
64 | > .#{$ns}-icon {
|
65 | position: absolute;
|
66 | top: 0;
|
67 |
|
68 |
|
69 | &:first-child {
|
70 | left: 0;
|
71 | }
|
72 |
|
73 | &:last-child {
|
74 | right: 0;
|
75 | }
|
76 | }
|
77 |
|
78 | .#{$ns}-button {
|
79 | @include pt-button-height($input-button-height);
|
80 | margin: ($pt-input-height - $input-button-height) / 2;
|
81 | padding: $button-padding-small;
|
82 |
|
83 |
|
84 | &:empty { padding: 0; }
|
85 | }
|
86 |
|
87 |
|
88 | > .#{$ns}-input-left-container,
|
89 | > .#{$ns}-icon {
|
90 | z-index: 1;
|
91 | }
|
92 |
|
93 |
|
94 | > .#{$ns}-input-left-container > .#{$ns}-icon,
|
95 | > .#{$ns}-icon {
|
96 | color: $pt-icon-color;
|
97 |
|
98 | &:empty {
|
99 | @include pt-icon($pt-icon-size-standard);
|
100 | }
|
101 | }
|
102 |
|
103 |
|
104 |
|
105 | > .#{$ns}-input-left-container > .#{$ns}-icon,
|
106 | > .#{$ns}-icon,
|
107 | .#{$ns}-input-action > .#{$ns}-spinner {
|
108 | margin: ($pt-input-height - $pt-icon-size-standard) / 2;
|
109 | }
|
110 |
|
111 | .#{$ns}-tag {
|
112 | margin: $pt-grid-size / 2;
|
113 | }
|
114 |
|
115 |
|
116 |
|
117 | .#{$ns}-input:not(:focus) + .#{$ns}-button,
|
118 | .#{$ns}-input:not(:focus) + .#{$ns}-input-action .#{$ns}-button {
|
119 | &.#{$ns}-minimal:not(:hover):not(:focus) {
|
120 | color: $pt-text-color-muted;
|
121 |
|
122 |
|
123 |
|
124 | .#{$ns}-dark & {
|
125 | color: $pt-dark-text-color-muted;
|
126 | }
|
127 |
|
128 | #{$icon-classes} {
|
129 | color: $pt-icon-color;
|
130 | }
|
131 | }
|
132 |
|
133 | &.#{$ns}-minimal:disabled {
|
134 |
|
135 |
|
136 | color: $pt-icon-color-disabled !important;
|
137 |
|
138 | #{$icon-classes} {
|
139 | color: $pt-icon-color-disabled !important;
|
140 | }
|
141 | }
|
142 | }
|
143 |
|
144 |
|
145 | &.#{$ns}-disabled {
|
146 |
|
147 | cursor: not-allowed;
|
148 |
|
149 | .#{$ns}-icon {
|
150 | color: $pt-icon-color-disabled;
|
151 | }
|
152 | }
|
153 |
|
154 | &.#{$ns}-large {
|
155 | .#{$ns}-button {
|
156 | @include pt-button-height($input-button-height-large);
|
157 | margin: ($pt-input-height-large - $input-button-height-large) / 2;
|
158 | }
|
159 |
|
160 | > .#{$ns}-input-left-container > .#{$ns}-icon,
|
161 | > .#{$ns}-icon,
|
162 | .#{$ns}-input-action > .#{$ns}-spinner {
|
163 | margin: ($pt-input-height-large - $pt-icon-size-standard) / 2;
|
164 | }
|
165 |
|
166 | .#{$ns}-input {
|
167 | @include pt-input-large();
|
168 |
|
169 | &:not(:first-child) {
|
170 | padding-left: $pt-button-height-large;
|
171 | }
|
172 |
|
173 | &:not(:last-child) {
|
174 | padding-right: $pt-button-height-large;
|
175 | }
|
176 | }
|
177 | }
|
178 |
|
179 | &.#{$ns}-small {
|
180 | .#{$ns}-button {
|
181 | @include pt-button-height($pt-button-height-smaller);
|
182 | margin: ($pt-input-height-small - $pt-button-height-smaller) / 2;
|
183 | }
|
184 |
|
185 | .#{$ns}-tag {
|
186 | @include pt-button-height($pt-button-height-smaller);
|
187 | margin: ($pt-input-height-small - $pt-button-height-smaller) / 2;
|
188 | }
|
189 |
|
190 | > .#{$ns}-input-left-container > .#{$ns}-icon,
|
191 | > .#{$ns}-icon,
|
192 | .#{$ns}-input-action > .#{$ns}-spinner {
|
193 | margin: ($pt-input-height-small - $pt-icon-size-standard) / 2;
|
194 | }
|
195 |
|
196 | .#{$ns}-input {
|
197 | @include pt-input-small();
|
198 |
|
199 | &:not(:first-child) {
|
200 | padding-left: $pt-icon-size-standard + $input-small-padding;
|
201 | }
|
202 |
|
203 | &:not(:last-child) {
|
204 | padding-right: $pt-icon-size-standard + $input-small-padding;
|
205 | }
|
206 | }
|
207 | }
|
208 |
|
209 | &.#{$ns}-fill {
|
210 | flex: 1 1 auto;
|
211 | width: 100%;
|
212 | }
|
213 |
|
214 | &.#{$ns}-round {
|
215 | .#{$ns}-button,
|
216 | .#{$ns}-input,
|
217 | .#{$ns}-tag {
|
218 | border-radius: $pt-input-height;
|
219 | }
|
220 | }
|
221 |
|
222 | .#{$ns}-dark & {
|
223 | .#{$ns}-icon {
|
224 | color: $pt-dark-icon-color;
|
225 | }
|
226 |
|
227 | &.#{$ns}-disabled .#{$ns}-icon {
|
228 | color: $pt-dark-icon-color-disabled;
|
229 | }
|
230 | }
|
231 |
|
232 | @each $intent, $color in $pt-intent-colors {
|
233 | &.#{$ns}-intent-#{$intent} {
|
234 | .#{$ns}-input {
|
235 | @include pt-input-intent($color);
|
236 | }
|
237 |
|
238 | > .#{$ns}-icon {
|
239 | color: map-get($pt-intent-text-colors, $intent);
|
240 |
|
241 | .#{$ns}-dark & {
|
242 | color: map-get($pt-dark-intent-text-colors, $intent);
|
243 | }
|
244 | }
|
245 | }
|
246 | }
|
247 | }
|