-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Set floating-labels default color equal to the input placeholder color #39172
Conversation
Signed-off-by: pine3ree <[email protected]>
…lor) to allow extra customization Signed-off-by: pine3ree <[email protected]>
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.
Thanks for this PR @pine3ree
I'm not so sure about the change of color given the fact that is first a label, so should be black. But it's also temporary a kind of placeholder too when not focused. Maybe what's strange, is not having the same color when focused and not focused.
I'll let @mdo check that from a design point of view.
However, I'd say that having a $form-floating-label-color
(whatever the color chosen in the end) could be useful to override the default label color (when not focused).
@@ -1075,6 +1075,7 @@ $form-floating-input-padding-b: .625rem !default; | |||
$form-floating-label-height: 1.5em !default; | |||
$form-floating-label-opacity: .65 !default; | |||
$form-floating-label-transform: scale(.85) translateY(-.5rem) translateX(.15rem) !default; | |||
$form-floating-label-color: $input-placeholder-color !default; // When the label is acting as a placeholder |
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.
Comment can be removed. The naming of the Sass var is sufficient to understand what it does IMO.
$form-floating-label-color: $input-placeholder-color !default; // When the label is acting as a placeholder | |
$form-floating-label-color: $input-placeholder-color !default; |
Hello @julien-deramond , form what I've learned (but I could have missed something) labels (after
In all the cases listed above the label is actually positioned as an inside-input label and assigned a different color and size (more appropriate for the label role), while the default behavior (
Granted, at the same time it also acts as a label, so it has to be easy to read (like a placeholder). What is kind of confusing is that the Thanks and kind regards! |
I believe this can be closed since #39720 was merged. |
Hello @theodorejb, |
@pine3ree That PR didn't only change the background color. It also fixed the floating label color so it no longer looks like input text when acting as a placeholder. See the preview: https://deploy-preview-39720--twbs-bootstrap.netlify.app/docs/5.3/forms/floating-labels/ |
@theodorejb |
Motivation & Context
Floating labels (after not focused inputs and not plaintext form-control) are used as input placeholders, so they should have the same styling (read
$input-placeholder-color
) of actual input-placeholders.(edit)
Added (and used) new var:
to allow easier extra customization