I am attempting to follow this Stripe blog post:
https://stripe.com/blog/connect-front-end-experience
While my final product generally looks like what was in the tutorial, my browser seems to be placing in unintentional gaps. I'm reluctant to call them gaps since gap has a specific meaning in CSS grids, and my error seems to be more of a randomized rounding error.
Here are some pictures for comparison. Safari handles the grid more elegantly than chrome, but there are still issues. Notice the pixilated white lines in the photos.
Stripe final product:
My attempt on Safari:
My attempt on Chrome:
Here is the code I am using:
.stripes {
display: grid;
grid: repeat(5, 200px) / repeat(10, 1fr);
transform: skewY(-12deg);
transform-origin: 0;
}
.stripes :nth-child(1) {
grid-column: span 3;
}
.stripes :nth-child(2) {
grid-area: 3 / span 3 / auto / -1;
}
.stripes :nth-child(3) {
grid-row: 4;
grid-column: span 5;
}
.blue {
background: blue;
}
.red {
background: red;
}
.special1 {
background: linear-gradient(to bottom left, #1890ff, #42C6EB);
}
.special2{
background: linear-gradient(to left, #1890ff, #42C6EB);
}
.special3{
background: linear-gradient(to left, rgba(66,198,235, 0.9), rgba(66,198,235,0.2));
}
.topRow {
background: linear-gradient(to top, rgb(52, 173, 242), #1890ff);
}
.secondRow {
background: linear-gradient(to top, #42C6EB, rgb(52, 173, 242))
}
.thirdRow {
background: #42C6EB
}
.fourthRow {
background: linear-gradient(to top, rgba(66,198,235,0.8), #42C6EB)
}
.fifthRow {
background: linear-gradient(to top, rgba(66,198,235,0.2), rgba(66,198,235,0.8))
}
<div class="stripes">
<div class="special1"></div>
<div class="special2"></div>
<div class="special3"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="topRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="secondRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="thirdRow"></div>
<div class="fourthRow"></div>
<div class="fourthRow"></div>
<div class="fourthRow"></div>
<div class="fourthRow"></div>
<div class="fourthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
<div class="fifthRow"></div>
</div>
After playing around a little bit, it seems the the issue lies in using the linear-gradient
. When I switch from a gradient to a solid color, vertical bars go away, but not the tiny aliased lines running along the diagonal stripes. Any ideas?