-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathusa-text-input.css.js
More file actions
107 lines (97 loc) · 2.72 KB
/
usa-text-input.css.js
File metadata and controls
107 lines (97 loc) · 2.72 KB
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
import { css } from "lit";
import "../uswds-core/system-vars.css";
import "../uswds-core/theme-vars.css";
export default css`
:host {
--theme-input-line-height: 1.3;
--theme-input-max-width: 30rem;
--theme-input-state-border-width: var(--usa-system-unit-05);
--theme-input-state-border-negative-margin: calc(
var(--usa-system-unit-1) - vcar(--theme-input-state-border-width)
);
input {
box-sizing: border-box;
background: var(--usa-theme-page-background-color);
border-width: 1px;
border-color: var(--usa-system-color-gray-cool-60);
border-style: solid;
border-radius: 0;
color: var(--usa-theme-text-color);
display: block;
height: 2.5rem;
margin-top: 0.5rem;
max-width: var(--usa-system-unit-mobile-lg);
padding: 0.5rem;
width: 100%;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-family:
Source Sans Pro Web,
Helvetica Neue,
Helvetica,
Roboto,
Arial,
sans-serif;
font-size: 1.06rem;
line-height: var(--theme-input-line-height);
}
input:not([disabled]):focus,
textarea:not([disabled]):focus {
outline-width: var(--usa-theme-focus-width);
outline-color: var(--usa-theme-focus-color);
outline-style: var(--usa-theme-focus-style);
outline-offset: var(--usa-theme-focus-offset);
}
input:disabled {
background-color: var(--usa-theme-color-disabled-lighter);
color: var(--usa-theme-color-disabled-dark);
cursor: not-allowed;
}
label {
color: var(--usa-theme-text-color);
font-family:
Source Sans Pro Web,
Helvetica Neue,
Helvetica,
Roboto,
Arial,
sans-serif;
font-size: 1.06rem;
line-height: var(--theme-input-line-height);
display: block;
font-weight: 400;
margin-top: var(--usa-system-unit-3);
max-width: var(--usa-system-unit-mobile-lg);
}
}
:host([state=success]),
:host([state=error]) {
input {
border-width: var(--theme-input-state-border-width);
padding-top: var(--theme-input-state-border-negative-margin);
padding-bottom: var(--theme-input-state-border-negative-margin);
}
}
:host([state=success]) {
input {
border-color: var(--usa-system-color-green-cool-40v);
}
}
:host([state=error]) {
input {
border-color: var(--usa-theme-color-error-dark);
}
label {
font-weight: 700;
margin-top: 0;
}
}
:host([state=disabled]) {
input {
background-color: var(--usa-theme-color-disabled-lighter);
color: var(--usa-theme-color-disabled-dark);
cursor: not-allowed;
}
}
`;