-
Notifications
You must be signed in to change notification settings - Fork 130
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
WCAG-upgrade -- add an example for grouping #2182
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move/add this example with the scaffolding common component. The folder: "/common/scaffolding/"
common/grouping/grouping-en.html
Outdated
<header> | ||
<h1><a href="/">My fancy blog</a></h1> | ||
... | ||
<search> | ||
<form action="search.php"> | ||
<label for="query">Find an article</label> | ||
<input id="query" name="q" type="search"> | ||
<button type="submit">Go!</button> | ||
</form> | ||
</search> | ||
</header> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust the example to be more focus on the search element and to avoid issue with multiple h1 and header that are not explicitly in a sectioning element.
<header> | |
<h1><a href="/">My fancy blog</a></h1> | |
... | |
<search> | |
<form action="search.php"> | |
<label for="query">Find an article</label> | |
<input id="query" name="q" type="search"> | |
<button type="submit">Go!</button> | |
</form> | |
</search> | |
</header> | |
<search> | |
<form action="search.php"> | |
<label for="query">Find an article</label> | |
<input id="query" name="q" type="search"> | |
<button type="submit">Go!</button> | |
</form> | |
</search> |
common/grouping/grouping-en.html
Outdated
<div> | ||
<h3>This is a heading in a div element</h3> | ||
<p>This is some text in a div element.</p> | ||
</div> | ||
<pre><code><div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we do use a lot of div every where, please add the following 2 example:
Multiple div's
<div><div>
<div>
<h3>This is a heading in a div element</h3>
</div>
<div>
<p>This is some text in a div element.</p>
</div>
</div></div>
Empty div
<div></div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duboisp In the first example there are two div's at the start
Does it need to only one div
<div>
<div>
<h3>This is a heading in a div element</h3>
</div>
<div>
<p>This is some text in a div element.</p>
</div>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep an example with multiple <div>
to show and to ensure that wrapping <div>
are always transparent. For example AEM do wrap component with one or more div.
common/grouping/grouping-fr.html
Outdated
@@ -0,0 +1,256 @@ | |||
--- | |||
{ | |||
"title": "Grouping Content - Scaffolding", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"title": "Grouping Content - Scaffolding", | |
"title": "Contenu de groupement - Échafaudage", |
common/grouping/grouping-fr.html
Outdated
"language": "fr", | ||
"altLangPage": "grouping-en.html", | ||
"breadcrumbs": [ | ||
{ "title": "GCWeb home", "link": "https://wet-boew.github.io/GCWeb/index-en.html" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ "title": "GCWeb home", "link": "https://wet-boew.github.io/GCWeb/index-en.html" } | |
{ "title": "GCWeb accueil", "link": "https://wet-boew.github.io/GCWeb/index-fr.html" } |
common/grouping/grouping-fr.html
Outdated
|
||
<div lang="en"> | ||
<div class="alert alert-warning"> | ||
<p>The purpose of this page is to test all native content grouping related elements, if they are aligned with our design and are compliant to our accessibility guideline when used as is without any special customization. The following include all content grouping elements in the HTML5 specification and a few examples was inspired by the <a href="https://html.spec.whatwg.org/multipage/forms.html#forms">WHATWG section 4.4</a> as February 2023. This page may not contain all the possible grouping content element combination.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see the translation in this page: https://wet-boew.github.io/GCWeb/common/scaffolding/formulaires.html
common/grouping/grouping-en.html
Outdated
<pre><code> | ||
<pre><code><p> ... </p></code></pre> | ||
</code></pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common/grouping/grouping-en.html
Outdated
<h2>The <code>dl</code> element</h2> | ||
<p> In the following example, one entry ("Authors") is linked to two values ("John" and "Luke"). </p> | ||
<dl> | ||
<dt> Authors </dt> | ||
<dd> John </dd> | ||
<dd> Luke </dd> | ||
<dt> Editor </dt> | ||
<dd> Frank </dd> | ||
</dl> | ||
|
||
<p> In the following example, one definition is linked to two terms. </p> | ||
<dl> | ||
<dt lang="en-US"> <dfn>color</dfn> </dt> | ||
<dt lang="en-GB"> <dfn>colour</dfn> </dt> | ||
<dd> A sensation which (in humans) derives from the ability of | ||
the fine structure of the eye to distinguish three differently | ||
filtered analyses of a view. </dd> | ||
</dl> | ||
|
||
<p> The following example illustrates the use of the dl element to mark up metadata of sorts. At the end of the example, one group has two metadata labels ("Authors" and "Editors") and two values ("Robert Rothman" and "Daniel Jackson"). This example also uses the div element around the groups of dt and dd element, to aid with styling. </p> | ||
<dl> | ||
<div> | ||
<dt> Last modified time </dt> | ||
<dd> 2004-12-23T23:33Z </dd> | ||
</div> | ||
<div> | ||
<dt> Recommended update interval </dt> | ||
<dd> 60s </dd> | ||
</div> | ||
<div> | ||
<dt> Authors </dt> | ||
<dt> Editors </dt> | ||
<dd> Robert Rothman </dd> | ||
<dd> Daniel Jackson </dd> | ||
</div> | ||
</dl> | ||
|
||
<p> The following example shows the dl element used to give a set of instructions. The order of the instructions here is important (in the other examples, the order of the blocks was not important). </p> | ||
<p>Determine the victory points as follows (use the | ||
first matching case):</p> | ||
<dl> | ||
<dt> If you have exactly five gold coins </dt> | ||
<dd> You get five victory points </dd> | ||
<dt> If you have one or more gold coins, and you have one or more silver coins </dt> | ||
<dd> You get two victory points </dd> | ||
<dt> If you have one or more silver coins </dt> | ||
<dd> You get one victory point </dd> | ||
<dt> Otherwise </dt> | ||
<dd> You get no victory points </dd> | ||
</dl> | ||
|
||
<p> The following snippet shows a dl element being used as a glossary. Note the use of dfn to indicate the word being defined. </p> | ||
<dl> | ||
<dt><dfn>Apartment</dfn>, n.</dt> | ||
<dd>An execution context grouping one or more threads with one or | ||
more COM objects.</dd> | ||
<dt><dfn>Flat</dfn>, n.</dt> | ||
<dd>A deflated tire.</dd> | ||
<dt><dfn>Home</dfn>, n.</dt> | ||
<dd>The user's login directory.</dd> | ||
</dl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a few sub-heading to add some clarity,
Currently when rendered it is a little bit confusing
I propose:
<h2>The <code>dl</code> element</h2> | |
<p> In the following example, one entry ("Authors") is linked to two values ("John" and "Luke"). </p> | |
<dl> | |
<dt> Authors </dt> | |
<dd> John </dd> | |
<dd> Luke </dd> | |
<dt> Editor </dt> | |
<dd> Frank </dd> | |
</dl> | |
<p> In the following example, one definition is linked to two terms. </p> | |
<dl> | |
<dt lang="en-US"> <dfn>color</dfn> </dt> | |
<dt lang="en-GB"> <dfn>colour</dfn> </dt> | |
<dd> A sensation which (in humans) derives from the ability of | |
the fine structure of the eye to distinguish three differently | |
filtered analyses of a view. </dd> | |
</dl> | |
<p> The following example illustrates the use of the dl element to mark up metadata of sorts. At the end of the example, one group has two metadata labels ("Authors" and "Editors") and two values ("Robert Rothman" and "Daniel Jackson"). This example also uses the div element around the groups of dt and dd element, to aid with styling. </p> | |
<dl> | |
<div> | |
<dt> Last modified time </dt> | |
<dd> 2004-12-23T23:33Z </dd> | |
</div> | |
<div> | |
<dt> Recommended update interval </dt> | |
<dd> 60s </dd> | |
</div> | |
<div> | |
<dt> Authors </dt> | |
<dt> Editors </dt> | |
<dd> Robert Rothman </dd> | |
<dd> Daniel Jackson </dd> | |
</div> | |
</dl> | |
<p> The following example shows the dl element used to give a set of instructions. The order of the instructions here is important (in the other examples, the order of the blocks was not important). </p> | |
<p>Determine the victory points as follows (use the | |
first matching case):</p> | |
<dl> | |
<dt> If you have exactly five gold coins </dt> | |
<dd> You get five victory points </dd> | |
<dt> If you have one or more gold coins, and you have one or more silver coins </dt> | |
<dd> You get two victory points </dd> | |
<dt> If you have one or more silver coins </dt> | |
<dd> You get one victory point </dd> | |
<dt> Otherwise </dt> | |
<dd> You get no victory points </dd> | |
</dl> | |
<p> The following snippet shows a dl element being used as a glossary. Note the use of dfn to indicate the word being defined. </p> | |
<dl> | |
<dt><dfn>Apartment</dfn>, n.</dt> | |
<dd>An execution context grouping one or more threads with one or | |
more COM objects.</dd> | |
<dt><dfn>Flat</dfn>, n.</dt> | |
<dd>A deflated tire.</dd> | |
<dt><dfn>Home</dfn>, n.</dt> | |
<dd>The user's login directory.</dd> | |
</dl> | |
<h2 id="dl-element">The <code>dl</code> element</h2> | |
<dl> | |
<dt> Term 1 </dt> | |
<dd> Description 1 </dd> | |
<dt> Term 2</dt> | |
<dd> Description 2 </dd> | |
</dl> | |
<h3>With two consecutive description </h3> | |
<dl> | |
<dt> Authors </dt> | |
<dd> John </dd> | |
<dd> Luke </dd> | |
<dt> Editor </dt> | |
<dd> Frank </dd> | |
</dl> | |
<h3>With two consecutive term </h3> | |
<dl> | |
<dt lang="en-US"> color </dt> | |
<dt lang="en-GB"> colour </dt> | |
<dd> A sensation which (in humans) derives from the ability of | |
the fine structure of the eye to distinguish three differently | |
filtered analyses of a view. </dd> | |
</dl> | |
<h3>With grouping division <code><div></code></h3> | |
<dl> | |
<div> | |
<dt> Last modified time </dt> | |
<dd> 2004-12-23T23:33Z </dd> | |
</div> | |
<div> | |
<dt> Recommended update interval </dt> | |
<dd> 60s </dd> | |
</div> | |
<div> | |
<dt> Authors </dt> | |
<dt> Editors </dt> | |
<dd> Robert Rothman </dd> | |
<dd> Daniel Jackson </dd> | |
</div> | |
</dl> | |
<h3>As glossary with term definition <code><dfn></code></h3> | |
<dl> | |
<dt><dfn>Apartment</dfn>, n.</dt> | |
<dd>An execution context grouping one or more threads with one or | |
more COM objects.</dd> | |
<dt><dfn>Flat</dfn>, n.</dt> | |
<dd>A deflated tire.</dd> | |
<dt><dfn>Home</dfn>, n.</dt> | |
<dd>The user's login directory.</dd> | |
</dl> | |
<h2>The <code>dt</code> element</h2> | |
<p>Demoed with the following element: <a href="#dl-element"><code>dl</code></a></p> | |
<h2>The <code>dd</code> element</h2> | |
<p>Demoed with the following element: <a href="#dl-element"><code>dl</code></a></p> |
common/grouping/grouping-en.html
Outdated
|
||
<h2>The <code>figure</code> element</h2> | ||
<figure> | ||
<img src="pic_trulli.jpg" alt="Trulli" style="width:100%"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid inline style and we should link to a real image
- Please remove the "style" attribute
- Please change the img source + alt text for an existing image that are hosted in our Github
<img src="pic_trulli.jpg" alt="Trulli" style="width:100%"> | |
<img src="pic_trulli.jpg" alt="Trulli"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duboisp : Can you please give an example for existing image source?
common/grouping/grouping-en.html
Outdated
<figure> | ||
<p>'Twas brillig, and the slithy toves<br> | ||
Did gyre and gimble in the wabe;<br> | ||
All mimsy were the borogoves,<br> | ||
And the mome raths outgrabe.</p> | ||
<figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> | ||
</figure> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an example where the figcaption is the first child element
Like:
<figure> | |
<p>'Twas brillig, and the slithy toves<br> | |
Did gyre and gimble in the wabe;<br> | |
All mimsy were the borogoves,<br> | |
And the mome raths outgrabe.</p> | |
<figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> | |
</figure> | |
<figure> | |
<p>'Twas brillig, and the slithy toves<br> | |
Did gyre and gimble in the wabe;<br> | |
All mimsy were the borogoves,<br> | |
And the mome raths outgrabe.</p> | |
<figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> | |
</figure> | |
<figure> | |
<figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> | |
<p>'Twas brillig, and the slithy toves<br> | |
Did gyre and gimble in the wabe;<br> | |
All mimsy were the borogoves,<br> | |
And the mome raths outgrabe.</p> | |
</figure> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to mention this scaffolding example need to be moved along with other scaffolding in the folder "common/scaffolding" and you can simply update the index.json-ld along with the new pages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Incomplete check)
Need to add a reference at those 2 example in the existing index.json-ld file in the scaffolding folder.
@duboisp Pushed my changes cc: @jonasg-gc |
Will close the following duplicates