Skip to content
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

fix(components): update clearfix to improve accessibility #565

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 24 additions & 60 deletions src/__snapshots__/storyshots.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19806,11 +19806,8 @@ exports[`Storyshots Layout/Grid/Grid Responsive Columns 1`] = `

.circuit-8::before,
.circuit-8::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-8::after {
Expand Down Expand Up @@ -20064,11 +20061,8 @@ exports[`Storyshots Layout/Grid/Grid Responsive Skipping 1`] = `

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -20434,11 +20428,8 @@ exports[`Storyshots Layout/Grid/Grid Skipping Columns 1`] = `

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -20783,11 +20774,8 @@ exports[`Storyshots Layout/Grid/Grid Static Columns 1`] = `

.circuit-12::before,
.circuit-12::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-12::after {
Expand Down Expand Up @@ -21241,11 +21229,8 @@ exports[`Storyshots Layout/Grid/Row Base 1`] = `

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -21402,11 +21387,8 @@ exports[`Storyshots Layout/InlineElements Three Inline Elements 1`] = `

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -21512,11 +21494,8 @@ exports[`Storyshots Layout/InlineElements Three Inline Elements Inline On Mobile

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -21566,11 +21545,8 @@ exports[`Storyshots Layout/InlineElements Three Inline Elements Inline On Mobile

.circuit-6::before,
.circuit-6::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-6::after {
Expand Down Expand Up @@ -21649,11 +21625,8 @@ exports[`Storyshots Layout/InlineElements Two Inline Elements 1`] = `

.circuit-4::before,
.circuit-4::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-4::after {
Expand Down Expand Up @@ -21768,11 +21741,8 @@ exports[`Storyshots Layout/InlineElements Two Inline Elements With Ratios 1`] =

.circuit-4::before,
.circuit-4::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-4::after {
Expand Down Expand Up @@ -21895,11 +21865,8 @@ exports[`Storyshots Layout/InlineElements Two Inline Elements With Ratios Inline

.circuit-4::before,
.circuit-4::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-4::after {
Expand Down Expand Up @@ -21965,11 +21932,8 @@ exports[`Storyshots Layout/InlineElements Two Inline Elements With Ratios Inline

.circuit-4::before,
.circuit-4::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-4::after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ exports[`CreditCardDetails should render with default styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down Expand Up @@ -84,11 +81,8 @@ exports[`CreditCardDetails should render with default styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ exports[`InlineElements should render with default styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down Expand Up @@ -102,11 +99,8 @@ exports[`InlineElements should render with inlineMobile styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down Expand Up @@ -156,11 +150,8 @@ exports[`InlineElements should render with inlineMobile styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down Expand Up @@ -217,11 +208,8 @@ exports[`InlineElements should render with ratio styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down Expand Up @@ -287,11 +275,8 @@ exports[`InlineElements should render with ratio styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down
7 changes: 2 additions & 5 deletions src/components/Row/__snapshots__/Row.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ exports[`Row should render with default styles 1`] = `

.circuit-0::before,
.circuit-0::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' ';
display: table;
}

.circuit-0::after {
Expand Down
16 changes: 11 additions & 5 deletions src/styles/style-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,19 @@ export const createMediaQueries = mapValues(mediaExpression => {
});

export const clearfix = css`
/*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of table rather than "block" is only necessary if using
* ":before" to contain the top-margins of child elements.
*/
&::before,
&::after {
content: '.';
display: block;
height: 0;
width: 0;
overflow: hidden;
content: ' '; /* 1 */
display: table; /* 2 */
}
&::after {
clear: both;
Expand Down