A Pen by Michał Gołębiowski on CodePen.
Created
January 18, 2019 08:30
-
-
Save mgol/b69c19475d16544978d87c745c044dcc to your computer and use it in GitHub Desktop.
Safari bug with CSS Grid, display: contents & ::before/::after
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
<div class="grid"> | |
<div class="replaced"></div> | |
<span class="green"></span> | |
<span class="red"></span> | |
</div> |
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
.grid { | |
display: grid; | |
grid-template-columns: repeat(4, 150px); | |
} | |
.replaced { | |
display: contents; | |
} | |
.replaced::before, .replaced::after, .green, .red { | |
content: ""; | |
width: 100px; | |
height: 100px; | |
} | |
.replaced::before, .green { | |
background-color: green; | |
} | |
.replaced::after, .red { | |
background-color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment