1 | @import "../global/variables.css";
|
2 |
|
3 | @value unit from "../global/global.css";
|
4 |
|
5 | .container {
|
6 | composes: font-lower from "../global/global.css";
|
7 |
|
8 | position: relative;
|
9 |
|
10 | box-sizing: border-box;
|
11 | min-height: calc(unit * 8);
|
12 | padding-top: calc(unit * 2);
|
13 |
|
14 | & * {
|
15 | box-sizing: border-box;
|
16 | }
|
17 | }
|
18 |
|
19 | .borderless {
|
20 | min-height: calc(unit * 4);
|
21 | padding: 0;
|
22 | }
|
23 |
|
24 | .input {
|
25 | width: 100%;
|
26 | min-height: calc(unit * 4);
|
27 | padding: 0;
|
28 |
|
29 | border: none;
|
30 | outline: none;
|
31 | background: transparent;
|
32 |
|
33 | font: inherit;
|
34 | caret-color: var(--ring-main-color);
|
35 |
|
36 | @nest .clearable & {
|
37 | padding-right: calc(unit * 3);
|
38 |
|
39 | @nest [dir=rtl] & {
|
40 | padding-right: 0;
|
41 | padding-left: calc(unit * 3);
|
42 | }
|
43 | }
|
44 |
|
45 | @nest .light & {
|
46 | color: var(--ring-text-color);
|
47 | }
|
48 |
|
49 | @nest .dark & {
|
50 | color: var(--ring-dark-text-color);
|
51 | }
|
52 |
|
53 | &::placeholder {
|
54 | color: transparent;
|
55 | }
|
56 |
|
57 | &[disabled] {
|
58 | color: var(--ring-disabled-color);
|
59 | }
|
60 |
|
61 | |
62 |
|
63 |
|
64 |
|
65 | &:-webkit-autofill {
|
66 | &,
|
67 | &:hover,
|
68 | &:focus {
|
69 | transition: background-color 50000s ease-in-out 0s;
|
70 | }
|
71 |
|
72 | & ~ .label {
|
73 | top: calc(unit / 2);
|
74 |
|
75 | font-size: var(--ring-font-size-smaller);
|
76 | }
|
77 | }
|
78 |
|
79 |
|
80 | &::-ms-clear {
|
81 | display: none;
|
82 | }
|
83 | }
|
84 |
|
85 | .clear {
|
86 | position: absolute;
|
87 | top: 17px;
|
88 |
|
89 | right: 0;
|
90 |
|
91 | padding-right: 0;
|
92 |
|
93 | @nest .empty & {
|
94 | display: none;
|
95 | }
|
96 |
|
97 | @nest .borderless & {
|
98 | top: 0;
|
99 | }
|
100 |
|
101 | @nest [dir=rtl] & {
|
102 | right: auto;
|
103 | left: 0;
|
104 | }
|
105 | }
|
106 |
|
107 |
|
108 | .clear.clear {
|
109 | line-height: calc(unit * 4);
|
110 | }
|
111 |
|
112 | textarea.input {
|
113 | overflow: hidden;
|
114 |
|
115 | box-sizing: border-box;
|
116 | padding-top: unit;
|
117 |
|
118 | resize: none;
|
119 | }
|
120 |
|
121 | .label {
|
122 | position: absolute;
|
123 | top: calc(unit * 3 - 3px);
|
124 | left: 0;
|
125 |
|
126 | transition: transform var(--ring-fast-ease), color var(--ring-fast-ease);
|
127 | transform-origin: top left;
|
128 | pointer-events: none;
|
129 |
|
130 | @nest .light & {
|
131 | color: var(--ring-secondary-color);
|
132 | }
|
133 |
|
134 | @nest .dark & {
|
135 | color: var(--ring-dark-secondary-color);
|
136 | }
|
137 | }
|
138 |
|
139 | .input:focus ~ .label,
|
140 | .container.active > .label,
|
141 | .container:not(.empty) > .label {
|
142 | transform: translateY(calc(unit * -2 - 1px)) scale(calc(12 / 13));
|
143 | }
|
144 |
|
145 | .noLabel ::placeholder,
|
146 | .input:focus::placeholder {
|
147 | transition: color var(--ring-fast-ease);
|
148 | }
|
149 |
|
150 | .light.noLabel ::placeholder,
|
151 | .light :focus::placeholder {
|
152 | color: var(--ring-disabled-color);
|
153 | }
|
154 |
|
155 |
|
156 | .dark.noLabel ::placeholder,
|
157 |
|
158 | .dark :focus::placeholder {
|
159 | color: var(--ring-secondary-color);
|
160 | }
|
161 |
|
162 | .input:focus ~ .label {
|
163 | color: var(--ring-main-color);
|
164 | }
|
165 |
|
166 | .error > :focus ~ .label {
|
167 | color: var(--ring-error-color);
|
168 | }
|
169 |
|
170 | .underline {
|
171 | height: 1px;
|
172 |
|
173 | border-bottom-width: 1px;
|
174 | border-bottom-style: solid;
|
175 |
|
176 | @nest .light & {
|
177 | border-color: var(--ring-line-color);
|
178 | }
|
179 |
|
180 | @nest .dark & {
|
181 | border-color: var(--ring-dark-line-color);
|
182 | }
|
183 | }
|
184 |
|
185 | .input[disabled] ~ .underline {
|
186 | border-bottom-style: dashed;
|
187 | }
|
188 |
|
189 | .focusUnderline,
|
190 | .errorUnderline {
|
191 | width: 100%;
|
192 | height: 2px;
|
193 |
|
194 | transform: scaleX(0);
|
195 | transform-origin: top left;
|
196 | }
|
197 |
|
198 | .focusUnderline {
|
199 | margin-top: -1px;
|
200 |
|
201 | background: var(--ring-main-color);
|
202 | }
|
203 |
|
204 | .errorUnderline {
|
205 | margin-top: -2px;
|
206 |
|
207 | background: var(--ring-icon-error-color);
|
208 |
|
209 | @nest .dark & {
|
210 | background: var(--ring-error-color);
|
211 | }
|
212 | }
|
213 |
|
214 | .input:focus ~ .focusUnderline,
|
215 | .container.active > .focusUnderline,
|
216 | .error > .errorUnderline {
|
217 | transition: transform 0.15s ease-out;
|
218 | transform: scaleX(1);
|
219 | }
|
220 |
|
221 | .errorText {
|
222 | overflow: hidden;
|
223 |
|
224 | box-sizing: border-box;
|
225 | height: 0;
|
226 | padding: calc(unit / 2) 0 unit;
|
227 |
|
228 | transition: height 0.3s ease-out;
|
229 |
|
230 | color: var(--ring-error-color);
|
231 |
|
232 | font-size: var(--ring-font-size-smaller);
|
233 | line-height: var(--ring-line-height-lowest);
|
234 | }
|
235 |
|
236 | .sizeS {
|
237 | width: calc(unit * 12);
|
238 | }
|
239 |
|
240 | .sizeM {
|
241 | width: calc(unit * 30);
|
242 | }
|
243 |
|
244 | .sizeL {
|
245 | width: calc(unit * 50);
|
246 | }
|
247 |
|
248 | .sizeFULL {
|
249 | width: 100%;
|
250 | }
|