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

Inline checkbox and radio -> unecessarily different markup #20936

Closed
bkdotcom opened this issue Oct 19, 2016 · 1 comment
Closed

Inline checkbox and radio -> unecessarily different markup #20936

bkdotcom opened this issue Oct 19, 2016 · 1 comment

Comments

@bkdotcom
Copy link
Contributor

default stacked (and without label) markup:

<div class="form-check disabled">
  <label class="form-check-label">
    <input class="form-check-input" type="checkbox" value="pick me" disabled>
    Giant Meteor
  </label>
</div>

inline markup:

<label class="form-check-inline disabled">
  <input class="form-check-input" type="checkbox" value="pick me" disabled> I'm not grey - fixed in a5
</label>

Proposed markup for inline:
keep wrapper

; label's class is same as stacked; disabled class would go on the wrapper (consistent with stacked)

<div class="form-check form-check-inline disabled">
  <label class="form-check-label">
    <input class="form-check-input" type="checkbox" value="pick me" disabled>
    Same is good
  </label>
</div>
  • The only difference is the class attribute for the outer wrapper.
  • We're not removing the div + changing the label's class
  • adding the disabled class is consistent
  • procedural / dynamic / templating easier.. don't need a separate template for inline,, just a different class attribute on the wrapper

It makes no difference to me whether inline is accomplished by adding the class form-check-inline or replacing form-check with form-check-inline (seems like maintaining css - would be easier by adding form-check-inline)

Different markup leads to issues like #20799 (fix pending for a5)
(currently need separate selectors for inline .disabled)

(this annoyance exists in Bootstrap 3 as well - lets get it right in 4!) 🤓

bkdotcom added a commit to bkdotcom/bootstrap that referenced this issue Oct 25, 2016
@mdo mdo added this to the v4.0.0-alpha.6 milestone Nov 29, 2016
@mdo
Copy link
Member

mdo commented Nov 29, 2016

Original thinking was if I could keep markup and styling simpler, I should try to do so. Totally get that this leads to more complications though, so happy to take a look at the associated PR more.

mdo pushed a commit that referenced this issue Nov 29, 2016
* #20936 make inline checkbox/radio markup same as stacked

* tweak language and remove extra blank line in snippet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants