Skip to content

Commit

Permalink
Text spacing rewrite (#1923)
Browse files Browse the repository at this point in the history
* Add new letter-spacing rule and deprecate old one

* Add new word-spacing rule and deprecate old one

* Clean up assumptions

* Clean up

* Clean up

* Add new line-height rule and deprecate old one

* Replace old letter spacing version rather than deprecating it

* Replace old line height version rather than deprecating it

* Replace old word spacing version rather than deprecating it

* Target text nodes

* Improve background note

* Apply suggestion from review

* Clean up

* Target text nodes rather than their parents

* Target text nodes rather than their parents

* Add missing reference

* Update example

* Apply to parent of text nodes, not text nodes

* Apply suggestions from code review

Co-authored-by: Carlos Duarte <[email protected]>

* Typos

Co-authored-by: Carlos Duarte <[email protected]>

* Typos

---------

Co-authored-by: Carlos Duarte <[email protected]>
  • Loading branch information
WilcoFiers and Carlos Duarte committed Oct 13, 2023
1 parent 1a79734 commit e44aa82
Show file tree
Hide file tree
Showing 25 changed files with 991 additions and 1,359 deletions.
1,959 changes: 701 additions & 1,258 deletions content-assets/wcag-act-rules/testcases.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 1</title>
<title>Inapplicable Example 7</title>
</head>
<body>
<p style="letter-spacing: 0.1em">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 3</title>
<title>Passed Example 2</title>
</head>
<body>
<style>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 8</title>
<title>Inapplicable Example 9</title>
</head>
<body>
<p style="letter-spacing: 0.1em">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 7</title>
<title>Inapplicable Example 8</title>
</head>
<body>
<p style="letter-spacing: 0.1em">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 4</title>
<title>Passed Example 3</title>
</head>
<body>
<p style="letter-spacing: 0.1em !important; letter-spacing: 0.15em !important">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 3</title>
<title>Inapplicable Example 4</title>
</head>
<body>
<p style="position: absolute; top: -999em; letter-spacing: 0.1em !important;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 4</title>
<title>Inapplicable Example 5</title>
</head>
<body>
<p style="width: 60%">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 6</title>
<title>Inapplicable Example 6</title>
</head>
<body>
<style>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 2</title>
</head>
<body>
<div style="letter-spacing: 0.1em !important;"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 2</title>
<title>Passed Example 1</title>
</head>
<body>
<p style="letter-spacing: 0.15em !important">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 2</title>
<title>Inapplicable Example 3</title>
</head>
<body>
<p style="display: none; letter-spacing: 0.1em !important;">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 5</title>
</head>
<body>
<div style="font-size: 16px; letter-spacing: 2px !important">
<p style="font-size: 10px;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 6</title>
</head>
<body>
<div style="letter-spacing: 0.1em !important">
<p style="letter-spacing: 0.2em !important;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 5</title>
<title>Passed Example 4</title>
</head>
<body>
<p style="letter-spacing: 0.15em !important; letter-spacing: 0.1em">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 2</title>
</head>
<body>
<div style="line-height: 0.1em !important;"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 8</title>
</head>
<body>
<div style="letter-spacing: 1em !important">
<p style="letter-spacing: 1.5em !important; max-width: 200px;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 7</title>
</head>
<body>
<div style="font-size: 16px; line-height: 15px !important">
<p style="font-size: 10px; max-width: 200px;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 5</title>
</head>
<body>
<div style="font-size: 16px; word-spacing: 2px !important">
<p style="font-size: 10px;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 6</title>
</head>
<body>
<div style="word-spacing: 0.1em !important">
<p style="word-spacing: 0.2em !important;">
The toy brought back fond memories of being lost in the rain forest.
</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Inapplicable Example 2</title>
</head>
<body>
<div style="word-spacing: 0.1em !important;"></div>
</body>
</html>
Loading

0 comments on commit e44aa82

Please sign in to comment.