Skip to content

Make parameters table template WAI 2.0 compliant - #101

Closed
alademann wants to merge 2 commits into
SassDoc:masterfrom
alademann:improved-param-table-accessibility
Closed

Make parameters table template WAI 2.0 compliant#101
alademann wants to merge 2 commits into
SassDoc:masterfrom
alademann:improved-param-table-accessibility

Conversation

@alademann

Copy link
Copy Markdown
Contributor

These changes make the parameters table in the swig templates accessible according to WAI 2.0 Table Guidelines

@KittyGiraudel

Copy link
Copy Markdown
Member

Manually done. Will be released in 1.0.0-rc.17.

@alademann

Copy link
Copy Markdown
Contributor Author

@hugogiraudel I'm not sure I understand what you mean by "manually done" - the parameters table changes have not been merged in?

@KittyGiraudel

Copy link
Copy Markdown
Member

Aye. I manually made the change to achieve the same result. Merged on master, will be shipped with rc.17.

@alademann

Copy link
Copy Markdown
Contributor Author

@hugogiraudel don't mean to be a pest - but how does your change make it accessible? In master - the table markup is still the same as it was before your commit:

It's missing the scope information on the headers, and the first column in the <tbody> rows is still a <td> instead of a <th scope="row">. These are requirements for WAI/WCAG compliant markup.

  <table class="item__parameters">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Type</th>
        <th>Default value</th>
      </tr>
    </thead>
    <tbody>
      {% for parameter in item.parameters %}
        <tr class="item__parameter">
          <td data-label="name"><code>${{ parameter.name }}</code></td>
          <td data-label="desc">{{ parameter.description | markdown | default('&mdash;') | safe }}</td>
          <td data-label="type">
          {% if parameter.type == '*' %}
            Any
          {% else %}
            {{ parameter.type | split('|') | trim | capitalize | join(', ')}}
          {% endif %}
          </td>
          <td data-label="default">
          {% if not parameter.default %}
            &mdash;
          {% else %}
            <code>{{ parameter.default }}</code>
          {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>

@KittyGiraudel

Copy link
Copy Markdown
Member

I missed that. I thought it was only about the display: none on the thead. I'll have a fix.

KittyGiraudel added a commit that referenced this pull request Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants