openwebdocs / project

project documentation, policies & meeting minutes
http://openwebdocs.org
Creative Commons Zero v1.0 Universal
359 stars 42 forks source link

Subtask: checkbox best practices #134

Closed estelle closed 4 months ago

estelle commented 2 years ago

Problem statement

The following have checkboxes that need to be checked for best practices:

/css-examples/css-text/word-break-checkbox.html:

   32      <section class="preview">
   33        <div class="field">
   34:         <input type="checkbox" id="one"><label for="one">LongWordThatHasNoBreakingPossibilities</label>
   35        </div>
   36  
   37        <div class="field field-br">
   38:         <input type="checkbox" id="two"><label for="two">LongWordThatHasNoBreakingPossibilities</label>
   39        </div>
   40      </section>
   ..
   48      <textarea class="playable playable-html" style="height: 180px;">
   49  <div class="field">
   50:   <input type="checkbox" id="one"><label for="one">LongWordThatHasNoBreakingPossibilities</label>
   51  </div>
   52  
   53  <div class="field field-br">
   54:   <input type="checkbox" id="two"><label for="two">LongWordThatHasNoBreakingPossibilities</label>
   55  </div>
   56      </textarea>

/interactive-examples/live-examples/html-examples/forms/label.html:

    1  <div class="preference">
    2      <label for="cheese">Do you like cheese?</label>
    3:     <input type="checkbox" name="cheese" id="cheese">
    4  </div>
    5  
    6  <div class="preference">
    7      <label for="peas">Do you like peas?</label>
    8:     <input type="checkbox" name="peas" id="peas">
    9  </div>

/learning-area/accessibility/aria/form-validation-checkbox-disabled.html:

   82        <div>
   83          <label for="musician">Musician:</label>
   84:         <input type="checkbox" name="musician" id="musician">
   85        </div>
   86        <div>

/learning-area/javascript/building-blocks/allowance-updater.html:

    8    <body>
    9      <label for="shopping-check">Has the shopping been done? </label>
   10:     <input type="checkbox" id="shopping-check">

/learning-area/html/forms/pseudo-classes/enabled-disabled-shipping.html:

   87          <div>
   88            <label for="billing-checkbox">Same as shipping address:</label>
   89:           <input type="checkbox" id="billing-checkbox" checked>
   90          </div>

/learning-area/html/forms/toggle-switch-example/index.html:

  111      <ul>
  112        <li>
  113:         <input type="checkbox" name="power" id="power">
  114          <label for="power"><span class="on">On</span> <span class="off">Off</span></label>
  115        </li>

/learning-area/css/css-layout/practical-positioning-examples/hidden-info-panel.html:

   53    <label for="toggle">❔</label>
   54:   <input type="checkbox" id="toggle">
   55    <aside>
   56      <h2>Information</h2>

/learning-area/css/css-layout/practical-positioning-examples/hidden-info-panel-start.html:

   16    <label for="toggle">❔</label>
   17:   <input type="checkbox" id="toggle">
   18    <aside>
   19      <h2>Information</h2>

/learning-area/tools-testing/cross-browser-testing/strategies/hidden-info-panel.html:

   59    <label for="toggle">❔</label>
   60:   <input type="checkbox" id="toggle">
   61    <aside>
   62      <h2>Information</h2>

Proposed solutions

Some may be ok, but these are the ones that still need to be individually checked.

Elchi3 commented 4 months ago

I'm closing this. Feel free to file issues against mdn/content if there is remaining work to be done.