Skip to content

Commit

Permalink
Docs: add indeterminate disabled checkbox example (#36674)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Jul 6, 2022
1 parent 22c7503 commit 6cf7253
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion site/assets/js/snippets.js
Expand Up @@ -102,7 +102,9 @@
// Indeterminate checkbox example in docs and StackBlitz
document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]')
.forEach(checkbox => {
checkbox.indeterminate = true
if (checkbox.id.includes('Indeterminate')) {
checkbox.indeterminate = true
}
})

// -------------------------------
Expand Down
8 changes: 7 additions & 1 deletion site/content/docs/5.2/forms/checks-radios.md
Expand Up @@ -49,7 +49,13 @@ Checkboxes can utilize the `:indeterminate` pseudo class when manually set via J

Add the `disabled` attribute and the associated `<label>`s are automatically styled to match with a lighter color to help indicate the input's state.

{{< example >}}
{{< example class="bd-example-indeterminate" stackblitz_add_js="true" >}}
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckIndeterminateDisabled" disabled>
<label class="form-check-label" for="flexCheckIndeterminateDisabled">
Disabled indeterminate checkbox
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDisabled" disabled>
<label class="form-check-label" for="flexCheckDisabled">
Expand Down

0 comments on commit 6cf7253

Please sign in to comment.