DEV Community

Discussion on: Checklist: 56 guiding questions about web accessibility

 
ghost profile image
Ghost

It's not up yet, but is nothing fancy, just something like:

    <label for="someid">visible text or button</label>
    <input id="someid" class="hidden" type="checkbox">
    <div>
        <ul>
            <li>some item of the menu</li>
            ...
        </ul>
    </div>
  • I'm conflicted if those divs should be aside.
.hidden {
    display: none;
    visibility: hidden;
}

#the-menu { display: none; }
#someid:checked ~ #the-menu { display: block; }

The idea is to take advantage of the :checked and the ~ in css

About the tables, is similar but using the column table element to toggle visibility: collapse

Besides adding a hidden I think it doesn't muddy the html or css much, if you are hidding a lot of columns you can get something not that pretty like:

   ...

    <label for="togglebtn1">Razón social</label>
    <label for="togglebtn2">Tipo</label>
    <label for="togglebtn3">Rut</label>
    <label for="togglebtn4">Rubro</label>
    <label for="togglebtn5">Url</label>
    <label for="togglebtn6">Horario</label>
    <label for="togglebtn7">Comentario</label>
    <label for="togglebtn8">Estado</label>
    <label for="togglebtn9">Acciones</label>

    <section>
        <input class="hidden" id="togglebtn1" type="checkbox">
        <input class="hidden" id="togglebtn2" type="checkbox">
        <input class="hidden" id="togglebtn3" type="checkbox">
        <input class="hidden" id="togglebtn4" type="checkbox">
        <input class="hidden" id="togglebtn5" type="checkbox">
        <input class="hidden" id="togglebtn6" type="checkbox">
        <input class="hidden" id="togglebtn7" type="checkbox">
        <input class="hidden" id="togglebtn8" type="checkbox">
        <input class="hidden" id="togglebtn9" type="checkbox">

        <table>
            <colgroup>
                <col span="2">
                <col class="toggle1">
                <col class="toggle2">
                <col class="toggle3">
                <col class="toggle4">
                <col class="toggle5">
                <col class="toggle6">
                <col class="toggle7">
                <col class="toggle8">
                <col class="toggle9">
            </colgroup>

            <thead>
                <tr>
                    <th>Condominio</th>
                    ...

But all in all, I avoided JS, works fast, doesn't add much html or css and is just a visual aid, shouldn't mess with screen readers or other devices, even without css the result is readable enough. I hope it helps.

Thread Thread
 
sylwiavargas profile image
Sylwia Vargas

WOW I love this so much! What a great resource. This is really awesome. Thank you!