-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
gap
property for flexbox (#621)
Add visual tests for flexbox gap. Co-authored-by: Michael Ragazzon <[email protected]>
- Loading branch information
1 parent
8b18a7c
commit b5bf23d
Showing
19 changed files
with
740 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - horizontal</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-001-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-001-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 100px; | ||
display: flex; | ||
flex-direction: row; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
flex: 1 1 auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is <strong>a green vertical line between boxes</strong>.</p> | ||
<section> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - vertical</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-002-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gaps" rel="help" title="The 'gap' property"/> | ||
<link href="reference/gap-002-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
width: 200px; | ||
height: 400px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
flex: 1 1 auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is <strong>a green horizontal line between boxes</strong>.</p> | ||
<section> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</section> | ||
<hr/> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - rows and columns</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-003-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-003-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 200px; | ||
width: 400px; | ||
display: flex; | ||
gap: 20px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
width: 190px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there are <strong> green lines between boxes</strong>.</p> | ||
<section> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - intrinsic horizontal</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-004-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-004-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 100px; | ||
display: inline-flex; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there are <strong> green lines between boxes</strong>.</p> | ||
<section> | ||
<div>Black Panther</div> | ||
<div>Wonder Woman</div> | ||
<div>Storm</div> | ||
<div>Flash</div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - intrinsic vertical</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-005-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-005-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
display: inline-flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there are <strong> green lines between boxes</strong>.</p> | ||
<section> | ||
<div>Black Panther</div> | ||
<div>Wonder Woman</div> | ||
<div>Storm</div> | ||
<div>Flash</div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - wrap horizontal</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-006-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-006-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 100px; | ||
width: 200px; | ||
display: inline-flex; | ||
flex-wrap: wrap; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
color: white; | ||
height: 20px; | ||
} | ||
|
||
#bp { | ||
width: 120px; | ||
} | ||
|
||
#ww { | ||
width: 130px; | ||
} | ||
|
||
#s, #f { | ||
width: 40px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there are <strong> green lines between boxes</strong>.</p> | ||
<section> | ||
<div id="bp">Black Panther</div> | ||
<div id="ww">Wonder Woman</div> | ||
<div id="s">Storm</div> | ||
<div id="f">Flash</div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - wrap vertical</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-007-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-007-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 100px; | ||
width: 200px; | ||
display: inline-flex; | ||
flex-direction: column; | ||
flex-wrap: wrap; | ||
gap: 20px; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there are <strong> green lines between boxes</strong>.</p> | ||
<section> | ||
<div>Black Panther</div> | ||
<div>Wonder Woman</div> | ||
<div>Storm</div> | ||
<div>Flash</div> | ||
</section> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<rml> | ||
<head> | ||
<link type="text/rcss" href="/../Tests/Data/style.rcss"/> | ||
<title>CSS Flexbox Test: gap - row and column gap</title> | ||
<link href="https://test.csswg.org/suites/css-align-3_dev/nightly-unstable/xhtml1/gap-008-ltr.xht" rel="source"/> | ||
<link href="mailto:[email protected]" rel="author" title="Adam Argyle"/> | ||
<link href="https://www.w3.org/TR/css-grid-1/#gutters" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#column-row-gap" rel="help"/> | ||
<link href="https://www.w3.org/TR/css-align-3/#gap-legacy" rel="help"/> | ||
<link href="reference/gap-008-ref.rml" rel="match"/> | ||
<meta content="The 'gap' property enables putting space exclusively between items" name="assert"/> | ||
<style> | ||
section { | ||
background-color: green; | ||
height: 100px; | ||
width: 400px; | ||
display: flex; | ||
gap: 40px 20px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
section > div { | ||
background-color: grey; | ||
width: 190px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p> | ||
Test passes if there are <strong> 40px horizontal green lines and 20px vertical green lines between | ||
boxes</strong>. | ||
</p> | ||
<section> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</section> | ||
</body> | ||
</rml> |
Oops, something went wrong.