-
-
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
Form check markup #23444
Form check markup #23444
Conversation
…can style the text based on the input's state
I agree this is a fix for #23426, however it does not address the issue where a whole set of radio buttons or checkboxes is valid/invalid, with an invalid description for the whole set. Considering just server side validation, a value for a field (which might be a single value <-> radio buttons, or multiple values <-> checkboxes) is invalid. This means that not the See the image for a more detailed view of what I mean. It was made with BS alpha 4 I believe. |
What is the status of this PR? If it is likely that the I see the problem @hiddewie shows, wouldn't adding something like the following work? fieldset.is-#{state} {
.form-check-description {
color: $color;
}
} |
Status is this needs reviewing, testing, and ideally merging :). |
Need to look at #23503 as well. |
Superseded by #25050. |
This fixes #23426, but might constitute as a breaking change.
What changes
Validating an input within our
.form-check
component is straightforward—it'll handle:valid
and:invalid
with ease. However, styling the label's text based on the input's state is another thing. Let's look at what we have now:With the above HTML, you cannot style
Check me out
in CSS based on.form-check-input
's state. To make that happen, we need a sibling element to style, something like:That's what this PR changes all our checkboxes and radios to. This matches custom forms more and enables CSS-only validation of checkboxes/radios.
Breaking or non-breaking?
So, why the question of maybe breaks backward compatibility? It's not strictly required. Right now, there's no need to include it for anything but validation. However, it could help improve styling of disabled inputs as well. Here's the current CSS for disabled
.form-check
s, which requires a parent class:bootstrap/scss/_forms.scss
Lines 218 to 228 in 5b8738a
With this change, we could do:
Thoughts?