Skip to content

fix(text-area): ensure border-color token doesn't override invalid styles #10390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
*
* @prop --calcite-text-area-background-color: Specifies the background color of the component.
* @prop --calcite-text-area-border-color: Specifies the border color of the text area.
* @prop --calcite-text-area-border-color-invalid: Specifies the border color of the text area when the status is invalid.
* @prop --calcite-text-area-character-limit-text-color: Specifies the color of the character limit text displayed in footer of the component.
* @prop --calcite-text-area-divider-color: Specifies the color of the divider between the text area and footer.
* @prop --calcite-text-area-font-size: Specifies the font size of the thext area and footer.
* @prop --calcite-text-area-max-height: Specifies the the maximum height of the text area in the component.
* @prop --calcite-text-area-font-size: Specifies the font size of the text area and footer.
* @prop --calcite-text-area-max-height: Specifies the maximum height of the text area in the component.
* @prop --calcite-text-area-min-height: Specifies the minimum height of the text area in the component.
* @prop --calcite-text-area-max-width: Specifies the the maximum width of the text area in the component.
* @prop --calcite-text-area-max-width: Specifies the maximum width of the text area in the component.
* @prop --calcite-text-area-min-width: Specifies the minimum width of the text area in the component.
* @prop --calcite-text-area-text-color: Specifies the color of text in the component.
* @prop --calcite-text-area-footer-border-color: Specifies the border color of the footer.
Expand Down Expand Up @@ -63,7 +64,7 @@

&.text-area--invalid {
--calcite-internal-text-area-border-color: var(
--calcite-text-area-border-color,
--calcite-text-area-border-color-invalid,
var(--calcite-color-status-danger)
);

Expand Down Expand Up @@ -192,7 +193,10 @@
}

:host([status="invalid"]) {
--calcite-internal-text-area-border-color: var(--calcite-text-area-border-color, var(--calcite-color-status-danger));
--calcite-internal-text-area-border-color: var(
--calcite-text-area-border-color-invalid,
var(--calcite-color-status-danger)
);

.text-area:focus {
@apply focus-inset-danger;
Expand Down
1 change: 1 addition & 0 deletions packages/calcite-components/src/custom-theme/text-area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { html } from "../../support/formatting";
export const textAreaTokens = {
calciteTextAreaBackgroundColor: "",
calciteTextAreaBorderColor: "",
calciteTextAreaBorderColorInvalid: "",
calciteTextAreaCharacterLimitTextColor: "",
calciteTextAreaDividerColor: "",
calciteTextAreaFontSize: "",
Expand Down
2 changes: 2 additions & 0 deletions packages/calcite-components/src/demos/text-area.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--calcite-text-area-font-size: 25px;
--calcite-text-area-background-color: cadetblue;
--calcite-text-area-border-color: magenta;
--calcite-text-area-border-color-invalid: pink;
--calcite-text-area-character-limit-text-color: magenta;
--calcite-text-area-divider-color: yellow;
--calcite-text-area-text-color: brown;
Expand Down Expand Up @@ -251,6 +252,7 @@
tokens="
--calcite-text-area-background-color,
--calcite-text-area-border-color,
--calcite-text-area-border-color-invalid,
--calcite-text-area-character-limit-text-color,
--calcite-text-area-divider-color,
--calcite-text-area-font-size,
Expand Down
Loading