Skip to content

Commit c19024f

Browse files
authored
Editorial fixes and add 'requirement' label (#153)
* Editorial tweaks to introduction * Change to requirement and add text to describe requirement type * Fix sections * Add different colours for requirement level * Improve requirement type text * Fix grammar
1 parent 6ddf3c7 commit c19024f

File tree

4 files changed

+418
-424
lines changed

4 files changed

+418
-424
lines changed

explainer/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<section id='sotd'>
2020
<p>This is an updated draft of the WCAG 3.0 Explainer. It is informative, not normative, and is not expected to become a W3C Recommendation. It provides background on [[[?WCAG3]]].</p>
2121

22-
<p>To comment, <a href="https://github.com/w3c/wcag3/issues/new">file an issue in the W3C wcag3 GitHub repository</a>. The Working Group requests that public comments be filed as new issues, one issue per discrete comment. It is free to create a GitHub account to file issues. If filing issues in GitHub is not feasible, send email to <a href="mailto:[email protected]?subject=WCAG%203.0%20public%20comment">[email protected]</a> (<a href="https://lists.w3.org/Archives/Public/public-agwg-comments/">comment archive</a>). In-progress updates to the guidelines can be viewed in the <a href="https://w3c.github.io/wcag3/guidelines/">public editors’ draft</a>.</p>
22+
<p>To comment, <a href="https://github.com/w3c/wcag3/issues/new">file an issue in the W3C wcag3 GitHub repository</a>. The Working Group requests that public comments be filed as new issues, one issue per discrete comment. It is free to create a GitHub account to file issues. If filing issues in GitHub is not feasible, email <a href="mailto:[email protected]?subject=WCAG%203.0%20public%20comment">[email protected]</a> (<a href="https://lists.w3.org/Archives/Public/public-agwg-comments/">comment archive</a>). In-progress updates to the guidelines can be viewed in the <a href="https://w3c.github.io/wcag3/guidelines/">public editors’ draft</a>.</p>
2323

2424
</section>
2525
<section id="intro">

guidelines/guidelines.css

+10-9
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,33 @@ summary::after {
5353
a.internalDFN[title]:hover, .internalDFN[title]:active, a.internalDFN[title]:focus {
5454
cursor: help;
5555
}
56-
.provision h4, .provision h5 {
56+
.requirement h4, .requirement h5 {
5757
font-style: normal;
5858
font-weight: normal;
5959
font-size: 100%;
6060
color: #005A9C;
6161
}
62+
.requirement .requirement-type {
63+
font-size: 90%;
64+
font-variant: small-caps;
65+
color: #404040;
66+
}
6267

6368
.guideline {
6469
margin-left: 4em;
6570
position: relative;
6671
}
6772

68-
.guideline .provision {
73+
.guideline .requirement {
6974
margin-left: 4em;
7075
position: relative;
7176
}
7277

73-
.guideline-text, provision-text {
78+
.guideline-text, .requirement-text {
7479
font-size: 110%;
7580
margin-top: 0;
7681
}
77-
.guideline h3, .provision h4, .provision h5 {
82+
.guideline h3, .requirement h4, .requirement h5 {
7883
width: 100%;
7984
margin-bottom: 0;
8085
margin-top: .4em;
@@ -160,7 +165,7 @@ caption {
160165
content: "§";
161166
display: block;
162167
}
163-
.status-marker, .provision-type-marker {
168+
.status-marker {
164169
font-weight: 700;
165170
font-size: 11px;
166171
font-size: .6125rem;
@@ -176,10 +181,6 @@ caption {
176181
background: #d0e1f1;
177182
color: #091832;
178183
}
179-
.provision-type-marker {
180-
background: #6bc8fe;
181-
color: #111111;
182-
}
183184
a[href].status-link {
184185
color: var(--text);
185186
}

guidelines/guidelines.js

+21-29
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,29 @@ function addStatusMarkers() {
8080
});
8181
}
8282

83-
var provisionTypeLabels = {
83+
var requirementTypeLabels = {
8484
foundational: 'Used to test the most basic level of accessibility.',
85-
supplemental: 'Used for higher levels of conformance.',
86-
assertion: 'An attributable and documented statement of fact regarding procedures practiced in the development and maintenance of the content or product to improve accessibility.',
85+
supplemental: 'Used for higher levels of conformance.'
8786
}
8887

89-
function addProvisionTypeMarkers() {
90-
var typeKeys = Object.keys(provisionTypeLabels);
91-
typeKeys.forEach(function (provisionType) {
92-
var headingSelector = '[data-provision-type="' + provisionType + '"] > .header-wrapper';
93-
var headings = document.querySelectorAll(headingSelector);
94-
headings.forEach(function (heading) {
95-
var provisionTypeMarker = document.createElement("span");
96-
provisionTypeMarker.classList.add("provision-type-marker");
97-
provisionTypeMarker.innerHTML = sentenceCase(provisionType);
98-
heading.firstElementChild.insertAdjacentElement('beforeend', provisionTypeMarker);
99-
});
88+
function addRequirementType() {
89+
var requirements = document.querySelectorAll(".requirement");
90+
requirements.forEach(function (requirement) {
91+
var requirementType = requirement.getAttribute('data-requirement-type');
92+
var preText = document.createElement("span");
93+
var heading = requirement.querySelector("h5");
94+
preText.classList.add("requirement-type");
95+
if(requirementType == 'assertion') {
96+
preText.innerHTML = "Assertion ";
97+
} else if(requirementType == 'foundational' || requirementType == 'supplemental') {
98+
preText.innerHTML = sentenceCase(requirementType) + " requirement ";
99+
} else {
100+
preText.innerHTML = "Requirement ";
101+
}
102+
heading.insertAdjacentElement('afterbegin', preText);
100103
});
101104
}
102105

103-
104106
function removeDraftMethodLinks() {
105107
document.querySelectorAll('.method-link').forEach(function(node){
106108
uri = node.href;
@@ -160,19 +162,11 @@ function removeImgSize() {
160162
});
161163
}
162164

163-
function removeGLNum() {
164-
var tocEl = document.querySelector(".tocline > a[href=\"#guidelines\"]").parentNode.querySelector("ol");
165-
tocEl.querySelectorAll("bdi.secno").forEach(function(node){node.remove();});
166-
167-
var sectionEl = document.querySelector("#guidelines");
168-
sectionEl.querySelectorAll("bdi.secno").forEach(function(node){node.remove();});
169-
}
170-
171-
function removeProvisionNum() {
165+
function removeRequirementNum() {
172166
var tocEl = document.querySelector(".tocline > a[href=\"#guidelines\"]").parentNode.querySelector("ol");
173167
tocEl.querySelectorAll("ol ol ol ol bdi.secno").forEach(function(node){node.remove();});
174168

175-
document.querySelectorAll(".provision bdi.secno").forEach(function(node){node.remove();});
169+
document.querySelectorAll(".requirement bdi.secno").forEach(function(node){node.remove();});
176170
}
177171

178172
function outputJson() {
@@ -249,18 +243,16 @@ function moveStatusFilterToToc() {
249243
// scripts before Respec has run
250244
function preRespec() {
251245
adjustDfnData();
252-
linkOutcome();
253246
addSummaryMarkers();
254247
}
255248

256249
// scripts after Respec has run
257250
function postRespec() {
258251
adjustNormativity();
259252
removeDraftMethodLinks();
260-
addProvisionTypeMarkers();
253+
removeRequirementNum();
254+
addRequirementType();
261255
addStatusMarkers();
262256
removeImgSize();
263257
outputJson();
264-
// removeGLNum();
265-
removeProvisionNum();
266258
}

0 commit comments

Comments
 (0)