-
Notifications
You must be signed in to change notification settings - Fork 11
fix: set border- and label-color for in/valid state of textarea, custom select and input #4258
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
fe0c9b2
47323e2
2fed1af
9ce544a
f799e24
e3ca589
5e77ac3
7cbdd01
2c0d76f
7fc595d
151ff76
3527455
7f76068
69066bf
bda4286
f224e29
25b11d3
c64fa75
6458556
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -153,6 +153,24 @@ $db-min-inline-size: var( | |||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
@each $state, $variant in (valid: successful, invalid: critical) { | ||||||||||||||||||||||
&[data-custom-validity="#{$state}"] > label, | ||||||||||||||||||||||
&:has(> #{$selector}[data-custom-validity="#{$state}"]) > label { | ||||||||||||||||||||||
color: var(--db-#{$variant}-on-bg-basic-emphasis-70-default); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
@if ($selector == textarea) { | ||||||||||||||||||||||
&:has(> #{$selector}[data-custom-validity="#{$state}"]) { | ||||||||||||||||||||||
&::before, | ||||||||||||||||||||||
&::after { | ||||||||||||||||||||||
// necessary to force this override over the placeholder-content mixin's ::before rule | ||||||||||||||||||||||
// to avoid the label to influence the border of the textarea | ||||||||||||||||||||||
content: none !important; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -369,6 +387,16 @@ $input-valid-types: | |||||||||||||||||||||
#{colors.$db-adaptive-bg-basic-level-1-default} | ||||||||||||||||||||||
) !important; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
&:is(textarea) { | ||||||||||||||||||||||
@each $state, $variant in (valid: successful, invalid: critical) { | ||||||||||||||||||||||
&[data-custom-validity="#{$state}"] { | ||||||||||||||||||||||
border: var(--db-border-width-3xs) | ||||||||||||||||||||||
solid | ||||||||||||||||||||||
var(--db-#{$variant}-on-bg-basic-emphasis-70-default); | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We don't need this here replace https://github.com/db-ux-design-system/core-web/pull/4258/files#diff-fc8ed644a470e8653bcb58e284747ce63f7ab258a112d921ab5605159aa41a8cR204-R228 with: ` & {
I don't know why there was a workaround for textarea but with this we set all adaptive colors like we should. |
||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
// label | ||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot remove the content on
::before
or::after
it is a workaround to ensure the floating label stays above the text. You see the problem, when you add a lot of text into the textarea.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem with long texts. We could handle it like that
This way, we would keep the workaround and ensure that the label does not influence the border of the textarea.