Skip to content

Commit

Permalink
fix(a11y): ensure wcag compliance with 1.5 line-height for texts (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaDTH authored and ChristiaanScheermeijer committed Feb 29, 2024
1 parent 2ccc932 commit f621ef7
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 44 deletions.
4 changes: 2 additions & 2 deletions packages/ui-react/src/components/Adyen/AdyenForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
color: variables.$white;
font-family: var(--body-font-family);
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
}

.adyen-checkout__error-text {
Expand All @@ -20,6 +20,6 @@
color: variables.$white;
font-family: var(--body-font-family);
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
}
}
13 changes: 6 additions & 7 deletions packages/ui-react/src/components/Card/Card.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@

&.featured {
.title {
height: 1.1em;
height: variables.$base-line-height;
padding-right: 8px;
font-family: var(--body-font-family);
font-size: 34px;
line-height: 36px;
line-height: variables.$base-line-height;
white-space: nowrap;
text-overflow: ellipsis;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);

@include responsive.mobile-only {
font-size: 24px;
line-height: 26px;
}
}

Expand Down Expand Up @@ -126,7 +125,7 @@
font-weight: var(--body-font-weight-bold);

font-size: 18px;
line-height: 20px;
line-height: variables.$base-line-height;
}

$aspects: ((1, 1), (2, 1), (2, 3), (4, 3), (5, 3), (16, 9), (9, 16), (9, 13));
Expand All @@ -145,13 +144,13 @@ $aspects: ((1, 1), (2, 1), (2, 3), (4, 3), (5, 3), (16, 9), (9, 16), (9, 13));
}

.title {
height: 2.4em;
height: calc(variables.$base-line-height * 2);
overflow: hidden;
color: var(--card-color);
font-family: var(--body-alt-font-family);
font-weight: var(--body-font-weight-bold);
font-size: 1em;
line-height: 1.2em;
line-height: variables.$base-line-height;
text-align: left;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);

Expand All @@ -174,7 +173,7 @@ $aspects: ((1, 1), (2, 1), (2, 3), (4, 3), (5, 3), (16, 9), (9, 16), (9, 13));

.scheduledStart {
font-size: 0.88em;
line-height: 1em;
line-height: variables.$base-line-height;

@include responsive.mobile-only {
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '@jwp/ott-ui-react/src/styles/variables';
@use '@jwp/ott-ui-react/src/styles/theme';
@use '@jwp/ott-ui-react/src/styles/accessibility';
@use '@jwp/ott-ui-react/src/styles/mixins/typography';

.backButton {
position: absolute;
Expand Down Expand Up @@ -108,7 +109,7 @@
.couponCell {
padding-top: 8px;
padding-bottom: 8px;
line-height: 1em;
line-height: variables.$base-line-height;

& > small {
font-size: 14px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
padding: 14px 16px;
color: inherit;
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
text-align: center;
background: transparent;
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
color: variables.$gray-white;
font-weight: 400;
font-size: 30px;
line-height: 28px;
line-height: variables.$base-line-height;
text-align: center;
}

Expand All @@ -45,7 +45,7 @@
padding: 0;
color: variables.$gray-white;
font-size: 16px;
line-height: 20px;
line-height: variables.$base-line-height;
text-align: left;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $disabled-gradient: linear-gradient(to top, #ddd, $disabled-bg-color 33%);
font-family: inherit;
font-weight: theme.$body-font-weight-bold;
font-size: 1rem;
line-height: 1em;
line-height: variables.$base-line-height;
text-overflow: ellipsis;
background: none;
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
padding-bottom: 20px;
color: variables.$gray-white;
font-size: 17px;
line-height: 21px;
line-height: variables.$base-line-height;
text-align: left;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,13 @@
font-family: var(--body-font-family);
font-weight: theme.$body-font-weight-bold;
font-size: 16px;
line-height: 20px;
line-height: variables.$base-line-height;
white-space: nowrap;
text-overflow: ellipsis;

@include responsive.mobile-only {
margin: auto 0;
font-size: 14px;
line-height: 16px;
}
}

Expand All @@ -113,14 +112,13 @@
color: theme.$epg-text-color;
font-family: var(--body-font-family);
font-size: 14px;
line-height: 16px;
line-height: variables.$base-line-height;
white-space: nowrap;
text-overflow: ellipsis;

@include responsive.mobile-only {
margin-top: auto;
font-size: 12px;
line-height: 14px;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
.price {
margin-left: auto;
font-size: 20px;
line-height: 28px;
line-height: variables.$base-line-height;
}

.paymentFrequency {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/Panel/Panel.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
font-weight: normal;
font-size: 16px;
font-style: normal;
line-height: 18px;
line-height: variables.$base-line-height;
letter-spacing: 0.15px;
background: theme.$modal-bg;
box-shadow: theme.$panel-box-shadow;
Expand Down
7 changes: 3 additions & 4 deletions packages/ui-react/src/components/Payment/Payment.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
padding: calc(#{variables.$base-spacing} / 2) variables.$base-spacing;

font-size: 14px;
line-height: 18px;
line-height: variables.$base-line-height;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);
background: theme.$panel-bg;
border-radius: 4px;

> strong {
line-height: 16px;
letter-spacing: 0.25px;
}
}
Expand Down Expand Up @@ -51,11 +50,11 @@

.price {
font-size: 14px;
line-height: 18px;
line-height: variables.$base-line-height;

> strong {
font-weight: var(--body-font-weight-bold);
font-size: 24px;
line-height: 26px;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,23 @@
padding: calc(#{variables.$base-spacing} / 2) variables.$base-spacing;

font-size: 14px;
line-height: 18px;
line-height: variables.$base-line-height;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);
background: theme.$panel-bg;
border-radius: 4px;

> strong {
line-height: 16px;
letter-spacing: 0.25px;
}
}

.price {
font-size: 14px;
line-height: 18px;
line-height: variables.$base-line-height;

> strong {
font-weight: var(--body-font-weight-bold);
font-size: 24px;
line-height: 26px;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
align-items: center;
margin-bottom: 8px;
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
letter-spacing: 0.15px;

> :first-child {
Expand All @@ -89,7 +89,7 @@
margin-top: 24px;
margin-bottom: 8px;
font-size: 20px;
line-height: 20px;
line-height: variables.$base-line-height;
letter-spacing: 0.5px;

@include responsive.mobile-only() {
Expand All @@ -104,7 +104,7 @@
margin-top: 0;
margin-bottom: 24px;
font-size: 18px;
line-height: 20px;
line-height: variables.$base-line-height;
letter-spacing: 0.5px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ div.title {
margin-right: auto;
margin-bottom: 0;
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
letter-spacing: 0.15px;

> :first-child {
Expand All @@ -99,7 +99,7 @@ div.title {
margin-top: 24px;
margin-bottom: 8px;
font-size: 20px;
line-height: 20px;
line-height: variables.$base-line-height;
letter-spacing: 0.5px;

@include responsive.mobile-only() {
Expand All @@ -112,6 +112,6 @@ div.title {
min-height: 21px;
margin-bottom: 24px;
font-size: 18px;
line-height: 20px;
line-height: variables.$base-line-height;
letter-spacing: 0.5px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@
font-family: var(--body-alt-font-family);
font-weight: var(--body-font-weight-bold);
font-size: 24px;
line-height: 26px;
line-height: variables.$base-line-height;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);
}

.relatedVideosListTitle {
font-family: var(--body-alt-font-family);
font-weight: var(--body-font-weight-bold);
font-size: 20px;
line-height: 22px;
line-height: variables.$base-line-height;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/ui-react/src/containers/Cinema/Cinema.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
.primaryMetadata {
margin-bottom: 8px;
font-size: 16px;
line-height: 18px;
line-height: variables.$base-line-height;
letter-spacing: 0.15px;

@include responsive.mobile-only() {
Expand All @@ -78,7 +78,7 @@
margin-top: 4px;
margin-bottom: 8px;
font-size: 20px;
line-height: 20px;
line-height: variables.$base-line-height;
letter-spacing: 0.5px;

@include responsive.mobile-only() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '@jwp/ott-ui-react/src/styles/theme';
@use '@jwp/ott-ui-react/src/styles/mixins/typography';
@use '@jwp/ott-ui-react/src/styles/mixins/responsive';
@use '@jwp/ott-ui-react/src/styles/variables';

.inlinePlayer {
position: absolute;
Expand Down Expand Up @@ -73,7 +74,7 @@

@include responsive.mobile-only {
font-size: 16px;
line-height: 1em;
line-height: variables.$base-line-height;
}
}

Expand All @@ -83,12 +84,11 @@
margin-bottom: 16px;
font-family: var(--body-alt-font-family);
font-size: 16px;
line-height: 1.2em;
line-height: variables.$base-line-height;
text-align: center;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);

@include responsive.mobile-only {
font-size: 14px;
line-height: 1em;
}
}
2 changes: 1 addition & 1 deletion packages/ui-react/src/containers/Layout/Layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.footer {
padding: 20px 40px;
line-height: 18px;
line-height: variables.$base-line-height;
letter-spacing: 0.15px;
text-align: center;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2);
Expand Down
1 change: 1 addition & 0 deletions packages/ui-react/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $body-font-size: 16px !default;
$base-spacing: 16px !default;
$base-spacing-mobile: 8px !default;
$base-spacing-heading: 20px !default;
$base-line-height: 1.5em !default;

$container-width-mobile: 100% !default;
$container-width-tablet: 685px !default;
Expand Down
2 changes: 1 addition & 1 deletion platforms/web/test-e2e/tests/video_detail_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function runTestSuite(config: typeof testConfigs.svod, providerName: string) {

I.seeElement('div[aria-label="Collapse"]');
I.dontSeeElement('div[aria-label="Expand"]');
checkHeight('160px');
checkHeight('216px');

I.click('div[aria-label="Collapse"]');

Expand Down

0 comments on commit f621ef7

Please sign in to comment.