1
+ /* *
2
+ * CSS Custom Properties
3
+ *
4
+ * These properties can be overridden using the component's tag as selector.
5
+ *
6
+ * @prop --calcite-text-area-background-color: Specifies the background color of the component.
7
+ * @prop --calcite-text-area-border-color: Specifies the border color of the component.
8
+ * @prop --calcite-text-area-color-invalid: Specifies the color used to indicate an invalid state.
9
+ * @prop --calcite-text-area-character-limit-text-color: Specifies the color of the character limit text displayed in footer of the component.
10
+ * @prop --calcite-text-area-text-color: Specifies the color of text in the component.
11
+ *
12
+ */
13
+
1
14
:host {
2
15
@apply inline-block
3
16
relative
7
20
8
21
textarea {
9
22
@apply font-sans
10
- text-color- 1
11
23
relative
12
24
block
13
- bg-foreground- 1
14
25
box-border
15
- border-color-input
16
26
border
17
27
w-full
18
28
m- 0;
19
29
min-inline-size : theme (" spacing.48" );
20
30
border-block-end : 1px solid var (--calcite-color-border-3 );
31
+ color : var (--calcite-text-area-text-color , var (--calcite-color-text-1 ));
32
+ background-color : var (--calcite-text-area-background-color , var (--calcite-color-foreground-1 ));
33
+ border-color : var (--calcite-text-area-border-color , var (--calcite-color-border-input ));
34
+
21
35
@media screen and (max-width : 480px ) {
22
36
@apply resize-none ;
23
37
}
38
+
24
39
& :focus {
25
40
@apply focus-inset ;
26
41
}
42
+
27
43
& .text-area--invalid {
28
- @apply border-color-danger
29
- border
44
+ @apply border
30
45
border-solid
31
46
border-b ;
47
+ border-color : var (--calcite-text-area-color-invalid , var (--calcite-color-status-danger ));
48
+
32
49
& :focus {
33
50
@apply focus-inset-danger ;
34
51
}
@@ -40,27 +57,31 @@ textarea {
40
57
41
58
.footer {
42
59
@apply flex
43
- bg-foreground- 1
44
60
box-border
45
- border-color-input
46
61
border
47
62
border-solid
48
63
border-t- 0
49
64
items-center ;
65
+
66
+ background-color : var (--calcite-text-area-background-color , var (--calcite-color-foreground-1 ));
67
+ border-color : var (--calcite-text-area-border-color , var (--calcite-color-border-input ));
50
68
}
51
69
52
70
.character-limit {
53
71
@apply flex
54
72
justify-end
55
- text-color- 2
56
73
items-center
57
74
font-normal
58
75
whitespace-nowrap ;
76
+
77
+ color : var (--calcite-text-area-character-limit-text-color , var (--calcite-color-text-2 ));
59
78
}
60
79
61
80
.character--over-limit {
62
81
@apply font-bold
63
82
text-danger ;
83
+
84
+ color : var (--calcite-text-area-color-invalid , var (--calcite-color-status-danger ));
64
85
}
65
86
66
87
:host ([resize = " none" ]) textarea {
@@ -136,19 +157,22 @@ textarea {
136
157
137
158
:host ([status = " invalid" ]) {
138
159
textarea {
139
- @ apply border-color- danger ;
160
+ border-color : var ( --calcite-text-area-color-invalid , var ( --calcite-color-status- danger)) ;
140
161
}
141
162
textarea :focus {
142
163
@apply focus-inset-danger ;
143
164
}
144
165
}
145
166
146
167
.readonly {
147
- @apply bg-background font-medium ;
168
+ @apply font-medium ;
169
+ background-color : var (--calcite-text-area-background-color-readonly , var (--calcite-color-background ));
148
170
}
149
171
150
172
.border--color {
151
- @apply border-b border-color-input ;
173
+ @apply border-b ;
174
+ border-color : var (--calcite-text-area-border-color , var (--calcite-color-border-input ));
175
+
152
176
& :focus {
153
177
@apply border-b- 2;
154
178
}
0 commit comments