-
Notifications
You must be signed in to change notification settings - Fork 327
Update C42 to address issue 2433 #3231
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
Closed
Closed
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
8a7dc2f
Update C42 to add example for target size (minimum)
fstrr 1a61706
Added link to C42 to Target Size Enhanced
fstrr 4eb5a5f
Updated C42 link name in Target Size Minimum
fstrr 1b0aaa1
Updated the working examples for C42, fixed broken link
fstrr da577ee
Fix page heading text
fstrr 4f75ae5
update c42 working examples
fstrr 8643d8d
Delete SVGs as now using a sprite
fstrr 49b92f5
Tweak URLs in working examples
fstrr 156aeaf
Fixed least least typo
fstrr e1ebe46
Add abbr tag
fstrr 161d0df
Split (Min) technique from (Enhanced) technique
fstrr cf86d36
Edits to C42
fstrr 3fb4239
Update c42 working examples to use px instead of rem
fstrr 3fa1eae
Delete un-needed screen grab
fstrr 289d696
Rename working example to use “size” and not “spacing”
fstrr fcc3b82
Replace “spacing” with “size”, remove example 1
fstrr b258646
Updated procedure, change spacing to size
fstrr 3cfc5cb
examples → example
fstrr f632d50
Update references to C42 and new technique
fstrr 51aa663
Update text
fstrr 509a09d
Removed “that cannot be enlarged by a mechanism”
fstrr c5c3369
Shorten description
fstrr 933f663
Update description
fstrr c5aeeee
Merge branch 'main' into issue-2433
alastc b6e5446
Renaming the second technique
alastc cfcd92f
Update techniques/css/C44.html
fstrr 0b59134
Update techniques/css/C44.html
fstrr 62b6e23
Update techniques/css/C44.html
fstrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,11 +1,11 @@ | ||||||
| <!DOCTYPE html> | ||||||
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | ||||||
| <head> | ||||||
| <title>Using min-height and min-width to ensure sufficient target spacing</title> | ||||||
| <title>Using CSS to ensure sufficient target spacing</title> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| <link rel="stylesheet" type="text/css" href="../../css/editors.css"/> | ||||||
| </head> | ||||||
| <body> | ||||||
| <h1>Using min-height and min-width to ensure sufficient target spacing</h1> | ||||||
| <h1>Using <abbr title="Cascading Style Sheets">CSS</abbr> to ensure sufficient target spacing</h1> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| <section id="meta"> | ||||||
| <h2>Metadata</h2> | ||||||
| <p id="id"></p> | ||||||
|
|
@@ -18,67 +18,87 @@ <h2>When to Use</h2> | |||||
| </section> | ||||||
| <section id="description"> | ||||||
| <h2>Description</h2> | ||||||
| <p>The objective of this technique is to ensure that links in navigation or pagination menus will be spaced so that they fall within an area that measures at least 44 x 44 CSS pixels if the target area itself is smaller than that. The aim is to provide an adequate target clearance so the offset to adjacent targets is sufficient to prevent accidental pointer activation of adjacent targets.</p> | ||||||
|
|
||||||
| <p>The objective of this technique is to ensure that navigation or pagination links will be spaced so that they fall within an area that measures at least 44 × 44 CSS pixels if the target area itself is smaller than that. The aim is to provide an adequate target clearance so the offset to adjacent targets is sufficient to prevent accidental pointer activation of adjacent targets.</p> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| </section> | ||||||
|
|
||||||
| <section id="examples"> | ||||||
| <h2>Examples</h2> | ||||||
| <p>The following examples can be seen as rendered versions in the <a href="../../working-examples/css-pointer-spacing/">working examples</a>.</p> | ||||||
| <p>The following examples can be seen as <a href="../../working-examples/css-sufficient-target-spacing/">working examples</a>.</p> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| <section class="example"> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| <h3>Using a display value of inline-block and min-height / width</h3> | ||||||
| <p>The first example shows a situation where the targets (in this case, the linked numbers in th pagination menu) are smaller than 44 x 44 CSS pixels. However, the list items that contain them have a minimum height and width of 44 px set, so that sufficient target spacing is assured.</p> | ||||||
| <h3>Making pagination list-item elements at least 44px wide and 44px high</h3> | ||||||
| <p>This example shows a situation where the targets (in this case, the linked numbers in the pagination navigation) are smaller than 44 × 44 CSS pixels. However, the list items that contain them have a minimum height and width of 44 CSS pixels, so that sufficient target spacing is assured.</p> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| <figure id="pointer-spacing-block"> | ||||||
| <img src="img/pointer-spacing-1.png" alt="A horizontal pagination component immediately above the search results." /> | ||||||
| <img src="img/sufficient-spacing-pagination-1.png" alt="a pagination control with links for the previous page, pages 1 - 5, and the next page. Page 1 is visually highlighted." height="63" width="499"> | ||||||
| <figcaption>Example of using CSS to ensure enough spacing around targets</figcaption> | ||||||
| </figure> | ||||||
| <p>Given the following HTML:</p> | ||||||
| <pre><code><nav class="pag" aria-label="pagination menu"> | ||||||
| <ol class="pagination-1"> | ||||||
| <li><span>previous</span></li> | ||||||
| <li><strong>1</strong></li> | ||||||
| <li><a href="#">2</a></li> | ||||||
| <li><a href="#">3</a></li> | ||||||
| <li><a href="#">4</a></li> | ||||||
| <li><a href="#">5</a></li> | ||||||
| <li><a href="#">next</a></li> | ||||||
| </ol> | ||||||
| <h4>The HTML</h4> | ||||||
| <pre><code class="language-html"><nav aria-label="pagination"> | ||||||
| <ol class="pagination-list--1"> | ||||||
| <li><a>previous</a></li> | ||||||
| <li><a aria-current="page"><span class="visually-hidden">page </span>1</a></li> | ||||||
| <li><a href="/page-2"><span class="visually-hidden">page </span>2</a></li> | ||||||
| <li><a href="/page-3"><span class="visually-hidden">page </span>3</a></li> | ||||||
| <li><a href="/page-4"><span class="visually-hidden">page </span>4</a></li> | ||||||
| <li><a href="/page-5"><span class="visually-hidden">page </span>5</a></li> | ||||||
| <li><a href="/page-2">next</a></li> | ||||||
| </ol> | ||||||
| </nav></code></pre> | ||||||
| <p>The following CSS would ensure the minimum spacing is applied:</p> | ||||||
| <pre><code>ol.pagination-1 li { | ||||||
| display: inline-block; | ||||||
| min-width: 44px; | ||||||
| min-height: 44px; | ||||||
| <h4>The CSS</h4> | ||||||
| <pre><code class="language-css">.pagination-list--1{ | ||||||
| display: flex; | ||||||
| flex-wrap: wrap; | ||||||
| gap: 0.5em; | ||||||
| list-style: none; | ||||||
| padding: 0; | ||||||
| } | ||||||
|
|
||||||
| .pagination-list--1 li{ | ||||||
| display: flex; | ||||||
| min-height: 44px; | ||||||
| min-width: 44px; | ||||||
| padding: 0.5em; | ||||||
| }</code></pre> | ||||||
|
|
||||||
| </section> | ||||||
| <section class="example"> | ||||||
| <h3>Using a display value of flex and min-height / width</h3> | ||||||
| <p>The second example uses min-width and min-height on the targets (the linked numbers in the pagination menu) and not on the parent container, thereby meeting this target spacing Success Criterion and incidentally also the AAA Success Criterion 2.5.5 Target Size.</p> | ||||||
| <h3>Making pagination links at least 44px wide and 44px high</h3> | ||||||
| <p>This example uses <code class="language-css">min-width</code> and <code class="language-css">min-height</code> on the targets (the linked numbers in the pagination menu) and not on the list items.</p> | ||||||
| <figure id="pointer-spacing-flex"> | ||||||
| <img src="img/pointer-spacing-1.png" alt="A horizontal pagination component immediately above the search results. It looks identical to the previous example. " /> | ||||||
| <img src="img/sufficient-spacing-pagination-2.png" alt="a pagination control with links for the previous page, pages 1 - 5, and the next page. Page 1 is visually highlighted." height="66" width="481"> | ||||||
| <figcaption>Example of using CSS to ensure enough spacing within targets</figcaption> | ||||||
| </figure> | ||||||
| <p>Given the following HTML:</p> | ||||||
| <pre><code><nav class="pag" aria-label="pagination menu"> | ||||||
| <ol class="pagination-2"> | ||||||
| <li><span>previous</span></li> | ||||||
| <li><strong>1</strong></li> | ||||||
| <li><a href="#">2</a></li> | ||||||
| <li><a href="#">3</a></li> | ||||||
| <li><a href="#">4</a></li> | ||||||
| <li><a href="#">5</a></li> | ||||||
| <li><a href="#">next</a></li> | ||||||
| </ol> | ||||||
| </nav></code></pre> | ||||||
| <p>The following CSS ensures the minimum size is applied:</p> | ||||||
| <pre><code>ol.pagination-2 a, | ||||||
| ol.pagination-2 strong, | ||||||
| ol.pagination-2 span { | ||||||
| display: block; | ||||||
| line-height:44px; | ||||||
| min-height:44px; | ||||||
| min-width: 44px; | ||||||
| <h4>The HTML</h4> | ||||||
| <pre><code class="language-html"><nav aria-label="pagination"> | ||||||
| <ol class="pagination-list--2"> | ||||||
| <li><a>previous</a></li> | ||||||
| <li><a aria-current="page"><span class="visually-hidden">page </span>1</a></li> | ||||||
| <li><a href="/page-2"><span class="visually-hidden">page </span>2</a></li> | ||||||
| <li><a href="/page-3"><span class="visually-hidden">page </span>3</a></li> | ||||||
| <li><a href="/page-4"><span class="visually-hidden">page </span>4</a></li> | ||||||
| <li><a href="/page-5"><span class="visually-hidden">page </span>5</a></li> | ||||||
| <li><a href="/page-2">next</a></li> | ||||||
| </ol> | ||||||
| </nav></code></pre> | ||||||
| <h4>The CSS</h4> | ||||||
| <pre><code class="language-css">.pagination-list--2{ | ||||||
| display: flex; | ||||||
| gap: 0.5em; | ||||||
| list-style: none; | ||||||
| padding: 0; | ||||||
| } | ||||||
|
|
||||||
| .pagination-list--2 li{ | ||||||
| padding: 0.25em; | ||||||
| } | ||||||
|
|
||||||
| .pagination-list--2 a{ | ||||||
| align-items: center; | ||||||
| display: flex; | ||||||
| justify-content: center; | ||||||
| min-height: 44px; | ||||||
| min-width: 44px; | ||||||
| padding: 0.5em; | ||||||
| }</code></pre> | ||||||
| </section> | ||||||
|
|
||||||
|
|
@@ -90,24 +110,26 @@ <h2>Tests</h2> | |||||
| <h3>Procedure</h3> | ||||||
|
|
||||||
| <p>For each target that cannot be enlarged by a mechanism, is not inline, and is not covered by the essential exception:</p> | ||||||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| <ul> | ||||||
| <li>Check that the target has enough spacing so that the space around it measures at least 44px width and 44px height.</li> | ||||||
| </ul> | ||||||
| <ol> | ||||||
| <li>Check that the target measures at least 44px width and 44px height.</li> | ||||||
| </ol> | ||||||
| </section> | ||||||
| <section class="test-results"> | ||||||
| <h3>Expected Results</h3> | ||||||
| <ul> | ||||||
| <li>Check #1 is true</li> | ||||||
| <li>#1 is true.</li> | ||||||
| </ul> | ||||||
| </section> | ||||||
| </section> | ||||||
| <section id="related"> | ||||||
| <h2>Related Techniques</h2> | ||||||
| <ul> | ||||||
| <li><a href="adding-spacing-to-undersized-targets.html">CXXXXXX</a></li> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| </ul> | ||||||
|
|
||||||
| </section> | ||||||
| <section id="resources"> | ||||||
| <!-- <section id="resources"> | ||||||
| <h2>Resources</h2> | ||||||
|
|
||||||
| </section> | ||||||
| </section> --> | ||||||
| </body> | ||||||
| </html> | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <!DOCTYPE html> | ||
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> | ||
| <head> | ||
| <title>Using CSS to add spacing to undersized targets</title> | ||
| <link rel="stylesheet" type="text/css" href="../../css/editors.css"/> | ||
| </head> | ||
| <body> | ||
| <h1>Using <abbr title="Cascading Style Sheets">CSS</abbr> to add spacing to undersized targets</h1> | ||
| <section id="meta"> | ||
| <h2>Metadata</h2> | ||
| <p id="id"></p> | ||
| <p id="technology">CSS</p> | ||
| <p id="type"></p> | ||
| </section> | ||
| <section id="applicability"> | ||
| <h2>When to Use</h2> | ||
| <p>All technologies that support CSS and pointer input.</p> | ||
| </section> | ||
| <section id="description"> | ||
| <h2>Description</h2> | ||
| <p>The objective of this technique is to ensure that links in navigation menus have enough spacing around them so each link measures at least 24px width and 24px height. The aim is to provide an adequate target clearance to prevent accidental pointer activation of adjacent targets.</p> | ||
| </section> | ||
|
|
||
| <section id="examples"> | ||
| <h2>Examples</h2> | ||
| <p>The following example can be seen as a <a href="../../working-examples/css-undersized-target-spacing/">working example</a>.</p> | ||
|
|
||
| <section class="example"> | ||
| <h3>Adding spacing to undersized targets</h3> | ||
| <p>This example shows a situation where targets are smaller than 24 CSS pixels wide and 24 CSS pixels high. To meet Success Criterion 2.5.8, Target Size (Minimum), when a 24 CSS pixel diameter circle is centered on the bounding box of each target, the circles do not intersect another target or the circle for another undersized target. In this example, each target is 20 × 20 CSS pixels, and a 4 CSS pixel gap is added between each target's parent container to create the minimum required spacing.</p> | ||
| <figure> | ||
| <img src="img/adding-spacing-undersized-targets.png" alt="a line of four interactive icons: back, forwards, email, home." height="21" width="102"> | ||
| <figcaption>An example of inline undersized targets</figcaption> | ||
| </figure> | ||
| <h4>The <abbr title="HyperText Markup Language">HTML</abbr></h4> | ||
| <pre><code class="language-html"><nav aria-label="controls"> | ||
| <ol class="navigation-controls"> | ||
| <li><a href="/previous-page/"><img alt="Back" src="arrow-back.svg"></a></li> | ||
| <li><a href="/next-page/"><img alt="Forward" src="arrow-forward.svg"></a></li> | ||
| <li> | ||
| <a href="mailto:[email protected]?subject=WCAG%20C42%20Technique"> | ||
| <img alt="Email" src="email.svg"> | ||
| </a> | ||
| </li> | ||
| <li><a href="/"><img alt="Home" src="home.svg"></a></li> | ||
| </ol> | ||
| </nav></code></pre> | ||
| <h4>The CSS</h4> | ||
| <pre><code class="language-css">.navigation-controls{ | ||
| display: flex; | ||
| gap: 4px; | ||
| line-height: 0; | ||
| list-style: none; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .navigation-controls a{ | ||
| display: inline-block; | ||
| line-height: 0; | ||
| }</code></pre> | ||
|
|
||
| </section> | ||
| </section> | ||
| <section id="tests"> | ||
| <h2>Tests</h2> | ||
|
|
||
| <section class="test-procedure"> | ||
| <h3>Procedure</h3> | ||
| <p>For each undersized target that has no equivalent, that isn't inline or otherwise constrained by the line-height of non-target text, that hasn't had its size modified by the author, and whose presentation isn't essential:</p> | ||
| <ol> | ||
| <li>Check that the target has enough spacing so that the space around it measures at least 24px width and 24px height.</li> | ||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </ol> | ||
| </section> | ||
| <section class="test-results"> | ||
| <h3>Expected Results</h3> | ||
| <ul> | ||
| <li>#1 is true.</li> | ||
| </ul> | ||
| </section> | ||
| </section> | ||
| <section id="related"> | ||
| <h2>Related Techniques</h2> | ||
| <ul> | ||
| <li><a href="C42.html">Using CSS to ensure sufficient target spacing</a></li> | ||
fstrr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </ul> | ||
|
|
||
| </section> | ||
| <!-- <section id="resources"> | ||
| <h2>Resources</h2> | ||
| </section> --> | ||
| </body> | ||
| </html> | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.