Skip to content
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

Equalize TextArea styles with TextField styles #4971

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 4 additions & 26 deletions src/components/NcTextArea/NcTextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -365,44 +365,21 @@ export default {
&:focus-visible {
box-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px
}

// Align label text color with border color (on hover / focus)
&:focus + .textarea__label,
&:hover:not(:placeholder-shown) + .textarea__label {
color: var(--color-success-text);
}
}

&--error {
border-color: var(--color-error) !important; //Override hover border color
&:focus-visible {
box-shadow: rgb(248, 250, 252) 0px 0px 0px 2px, var(--color-primary-element) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px
}

// Align label text color with border color (on hover / focus)
&:focus + .textarea__label,
&:hover:not(:placeholder-shown) + .textarea__label {
color: var(--color-error-text);
}
}

// Align label text color with border color (on hover / focus)
&:not(&--success, &--error) {
&:focus + .textarea__label,
&:hover:not(:placeholder-shown) + .textarea__label {
color: var(--color-primary-element);
}
}
}

&__label {
position: absolute;
margin-inline: 12px 0;
// fix height and line height to center label
height: 17px;
max-width: fit-content;
line-height: 1;
inset-block-start: 12px;
inset-block-start: 11px;
inset-inline: 0;
// Fix color so that users do not think the input already has content
color: var(--color-text-maxcontrast);
Expand All @@ -418,10 +395,11 @@ export default {

&__input:focus + &__label,
&__input:not(:placeholder-shown) + &__label {
inset-block-start: -6px;
inset-block-start: -10px;
font-size: 13px; // minimum allowed font size for accessibility
font-weight: 500;
color: var(--color-main-text);
background-color: var(--color-main-background);
height: 14px;
padding-inline: 4px;
margin-inline-start: 8px;

Expand Down