Skip to content

Commit d275331

Browse files
committed
fix(text-area): add component tokens
1 parent 97dd07d commit d275331

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

packages/calcite-components/src/components/text-area/text-area.scss

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
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+
114
:host {
215
@apply inline-block
316
relative
@@ -7,28 +20,32 @@
720

821
textarea {
922
@apply font-sans
10-
text-color-1
1123
relative
1224
block
13-
bg-foreground-1
1425
box-border
15-
border-color-input
1626
border
1727
w-full
1828
m-0;
1929
min-inline-size: theme("spacing.48");
2030
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+
2135
@media screen and (max-width: 480px) {
2236
@apply resize-none;
2337
}
38+
2439
&:focus {
2540
@apply focus-inset;
2641
}
42+
2743
&.text-area--invalid {
28-
@apply border-color-danger
29-
border
44+
@apply border
3045
border-solid
3146
border-b;
47+
border-color: var(--calcite-text-area-color-invalid, var(--calcite-color-status-danger));
48+
3249
&:focus {
3350
@apply focus-inset-danger;
3451
}
@@ -40,27 +57,31 @@ textarea {
4057

4158
.footer {
4259
@apply flex
43-
bg-foreground-1
4460
box-border
45-
border-color-input
4661
border
4762
border-solid
4863
border-t-0
4964
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));
5068
}
5169

5270
.character-limit {
5371
@apply flex
5472
justify-end
55-
text-color-2
5673
items-center
5774
font-normal
5875
whitespace-nowrap;
76+
77+
color: var(--calcite-text-area-character-limit-text-color, var(--calcite-color-text-2));
5978
}
6079

6180
.character--over-limit {
6281
@apply font-bold
6382
text-danger;
83+
84+
color: var(--calcite-text-area-color-invalid, var(--calcite-color-status-danger));
6485
}
6586

6687
:host([resize="none"]) textarea {
@@ -136,19 +157,22 @@ textarea {
136157

137158
:host([status="invalid"]) {
138159
textarea {
139-
@apply border-color-danger;
160+
border-color: var(--calcite-text-area-color-invalid, var(--calcite-color-status-danger));
140161
}
141162
textarea:focus {
142163
@apply focus-inset-danger;
143164
}
144165
}
145166

146167
.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));
148170
}
149171

150172
.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+
152176
&:focus {
153177
@apply border-b-2;
154178
}

0 commit comments

Comments
 (0)