Skip to content

Commit

Permalink
Replace home template media query with container query
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelCDL committed May 15, 2024
1 parent 225a474 commit 81152ee
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions css/components/feature.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
.c-feature__media {
grid-column: 1 / 3;
grid-row: 2;
max-block-size: 27rem;
border: 2px solid black;

& img {
Expand Down Expand Up @@ -72,7 +71,7 @@
}
}

@media all and (width >= 50rem) and (not (90rem <= width <= 115rem)) {
@media (width >= 50rem) {
.c-feature {
grid-template-columns: 1fr 1fr;

Expand All @@ -99,3 +98,40 @@
grid-column: 2;
}
}

@media (width >= 90rem) {
.c-feature {
width: 99%;
height: 100%;
container-type: size;
}
}

@container (aspect-ratio <= 1.5/1) {
.c-feature {
grid-template-columns: 1fr auto;

& h1 {
grid-column: 1;
}

& time {
grid-column: 2;
place-self: end;
}

& p {
grid-column: 1 / 3;
}
}

.c-feature__media {
grid-column: 1 / 3;
grid-row: 2;
max-block-size: 27rem;
}

.c-feature__links {
grid-column: 1 / 3;
}
}

0 comments on commit 81152ee

Please sign in to comment.