Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class="reftest-wait">
<title>CSS Gap Decorations: adding children uncovers auto-fit tracks and updates grid-axis and stacking-axis rules in grid lanes</title>
<link rel="author" title="Javier Contreras" href="mailto:javiercon@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-gaps-1/">
<link rel="match" href="column-gap-decorations-auto-fit-dynamic-add-ref.html">
<style>
body { margin: 0; }
.stage {
width: 340px;
height: 90px;
}
/* Five tracks fit. Three initial items keep tracks 1-3, so tracks 4 and 5
collapse. */
.lanes {
display: grid-lanes;
grid-template-columns: repeat(auto-fit, 60px);
gap: 10px;
width: 340px;
background: #cdd5e0;
flow-tolerance: 0;
column-rule: 4px solid blue;
row-rule: 4px solid gold;
}
.lanes > div {
height: 40px;
background: #5b8def;
}
</style>
<div class="stage">
<div class="lanes">
<div></div>
<div></div>
<div></div>
</div>
</div>
<script>
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const lanes = document.querySelector(".lanes");
for (let i = 0; i < 3; ++i)
lanes.append(document.createElement("div"));
document.documentElement.classList.remove("reftest-wait");
});
});
</script>