Skip to content

Commit fa66732

Browse files
adampagepatrickhlaukembgower
authored
Replace raster images with SVG in Understanding SC 1.4.11: Non-Text Contrast (#4573)
Closes #4549. Replaces many of the raster images in [Understanding Non-Text Contrast](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html) with inlined SVG assets. This gives the example visuals higher fidelity in varying viewport sizes, user zoom levels, and high-density displays. Please compare [before](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html) and [after](https://deploy-preview-4573--wcag2.netlify.app/understanding/non-text-contrast). ⚠️ While doing this work, I also discovered that the current Understanding page has horizontal scrolling overflow in ~`320px` viewports because of the non-responsive tables like [“_Passing User Interface Component Examples_”](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html#:~:text=Passing%20User%20Interface%20Component%20Examples). I’ll create a separate issue & PR to see about resolving that. #4641 --------- Co-authored-by: Patrick H. Lauke <[email protected]> Co-authored-by: Mike Gower <[email protected]>
1 parent 5faa1ad commit fa66732

File tree

64 files changed

+473
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+473
-65
lines changed

css/base.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ margin: 1.2em 0;
203203
align-items: stretch;
204204
}
205205

206-
#site-header.minimal-header .minimal-header-name,
207-
#site-header.minimal-header .minimal-header-subtitle,
208-
#site-header.minimal-header .minimal-header-link
206+
#site-header.minimal-header .minimal-header-name,
207+
#site-header.minimal-header .minimal-header-subtitle,
208+
#site-header.minimal-header .minimal-header-link
209209
{
210210
display: flex;
211211
flex-direction: column;
@@ -411,7 +411,7 @@ font-size: 95%;
411411
.standalone-resource-about a,
412412
.standalone-resource-pager a,
413413
.standalone-resource-about span,
414-
.standalone-resource-pager span
414+
.standalone-resource-pager span
415415
{
416416
margin-left:.8em;
417417
margin-right:.8em;
@@ -444,6 +444,12 @@ figure svg {
444444
border: 1px solid var(--line-grey);
445445
}
446446

447+
main table svg[role*="image"],
448+
figure svg[role*="image"] {
449+
display: block;
450+
max-inline-size: 100%;
451+
}
452+
447453
figcaption {
448454
font-weight: initial;
449455
border-bottom: initial;

understanding/20/contrast-enhanced.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ <h3>Inactive User Interface Components</h3>
236236

237237
<p>User Interface Components that are not available for user interaction (e.g., a disabled control in HTML) are not required to meet contrast requirements. An inactive user interface component is visible but not currently operable. An example would be a submit button at the bottom of a form that is visible but cannot be activated until all the required fields in the form are completed.</p>
238238
<figure id="figure-grey-button-and-text">
239-
<img src="img/inactive-button.png" alt="Grey button with non-contrasting grey text." width="120">
239+
{% include "../21/img/1.4.11-ntc-button-inactive.svg" %}
240240
<figcaption> An inactive button using default browser styles</figcaption>
241241
</figure>
242242
</section>

understanding/20/contrast-minimum.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ <h3>Inactive User Interface Components</h3>
219219

220220
<p>User Interface Components that are not available for user interaction (e.g., a disabled control in HTML) are not required to meet contrast requirements. An inactive user interface component is visible but not currently operable. An example would be a submit button at the bottom of a form that is visible but cannot be activated until all the required fields in the form are completed.</p>
221221
<figure id="figure-grey-button-and-text">
222-
<img src="img/inactive-button.png" alt="Grey button with non-contrasting grey text." width="120">
222+
{% include "../21/img/1.4.11-ntc-button-inactive.svg" %}
223223
<figcaption> An inactive button using default browser styles</figcaption>
224224
</figure>
225225
</section>
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 25 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)