Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update feature component styles and responsive layout #2

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 56 additions & 17 deletions css/components/feature.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
grid-template-columns: 1fr auto;
grid-template-rows: auto auto 1fr auto;
gap: var(--space-base);
padding: var(--space-base);
padding: 1.5rem 2rem;
border-top: 3px solid var(--color-gold);
border-radius: var(--border-block-end-radius);
background-color: white;
container-type: inline-size;

& h1 {
margin: unset;
Expand All @@ -31,12 +30,12 @@
.c-feature__media {
grid-column: 1 / 3;
grid-row: 2;
border: 2px solid black;
border: 1px solid oklch(88% 0.015 85deg);

& img {
display: block;
block-size: 100%;
inline-size: 100%;
object-fit: cover;
}
}

Expand All @@ -46,35 +45,28 @@
grid-column: 1 / 3;
flex-wrap: wrap;
align-items: center;
justify-content: space-around;
gap: var(--space-base);
margin-block-start: var(--space-base);
gap: var(--space-lg);

& li {
all: unset;
}

& a {
font-size: 1.2rem;
font-weight: normal;
text-decoration: none;

&:active,
&:hover {
text-decoration: underline;
}
}

& strong a {
display: inline-block;
padding: 0.5rem 1rem;
background-color: oklch(98% 0.01 241deg);
font-weight: normal;
}
}

@media (width > 50rem) {
@media (width >= 50rem) {
.c-feature {
grid-template-columns: 1fr 1fr;
grid-template-columns: 1fr 1.5fr;

& h1 {
grid-column: 2;
Expand All @@ -93,9 +85,56 @@
.c-feature__media {
grid-column: 1;
grid-row: 1 / 5;

& img {
max-block-size: 25rem;
object-fit: contain;
}
}

.c-feature__links {
grid-column: 2;
}
}

@media (width >= 80rem) {
.c-feature {
grid-template-columns: 1fr 1fr;
width: calc(100% - var(--space-sm));
height: 100%;
container-type: size;
}

.c-feature__media {
& img {
max-block-size: 100%;
}
}
}

@container (aspect-ratio <= 1.5 / 1) {
.c-feature {
& 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;
min-block-size: 100%;
}

.c-feature__links {
grid-column: 1 / 3;
}
}
2 changes: 1 addition & 1 deletion css/templates/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
}
}

@media (width > 90rem) {
@media (width >= 80rem) {
.t-home {
& .t-top-section {
grid-template-columns: 1fr minmax(0, 59.5rem) minmax(0, 59.5rem) 1fr;
Expand Down
2 changes: 1 addition & 1 deletion src/components/feature.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<img src="{{ feature.image }}" alt="Random nature scene">
</div>
<ul class="c-feature__links">
<li><strong><a href="">Watch Recording</a></strong></li>
<li><a href="">Watch Recording</a></li>
<li><a href="">All Video Recordings</a></li>
</ul>
</article>
Loading