Skip to content

Commit

Permalink
Merge pull request #4971 from nextcloud-libraries/fix/42243-adapt_tex…
Browse files Browse the repository at this point in the history
…tarea_styles

Equalize `TextArea` styles with `TextField` styles
  • Loading branch information
emoral435 committed Dec 18, 2023
2 parents 59a5c8c + 05aebf1 commit da340d6
Showing 1 changed file with 4 additions and 26 deletions.
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

0 comments on commit da340d6

Please sign in to comment.