I am having trouble making my CSS Grid items go "full width" on mobile because I don't know how many columns there will be:
https://codepen.io/matthewfelgate/pen/Kvqdmp?editors=1100
* { outline: 1px dashed red; }
.box {
display: grid;
&__heading, &__text { padding: 1em; }
@media ( max-width: 800px ) {
}
@media ( min-width: 801px ) {
&__heading {
grid-row: 1;
}
&__text {
grid-column-start: 1;
grid-column-end: -1;
}
}
}
<div class="box">
<div class="box__heading">Heading 1</div>
<div class="box__text">Text 1</div>
<div class="box__heading">Heading 2</div>
<div class="box__text">Text 2</div>
<div class="box__heading">Heading 3</div>
<div class="box__text">Text 3</div>
<div class="box__heading">Heading 4</div>
<div class="box__text">Text 4</div>
</div>
grid-column-end: -1;
doesn't seem to work?
Edit: Don is right, I got the media queries round the wrong way. I am trying to do Tabs on Desktop and Accordion on Mobile.