Skip to content

Commit

Permalink
enhance(homepage): better socials block on homepage (#4472)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Jan 21, 2025
1 parent 55ad01f commit a40f02c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions site/gdocs/pages/Homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@
}

.homepage-social-ribbon__social-list {
grid-template-columns: 1fr; // fallback for browsers that don't support `max()` below.

// A bunch of magic CSS! Let me explain.
// The goal here is to span the social links over 1 or 2 columns, ensuring that each column is at least 120px wide.

// The width of a column if there are precisely 2 columns - we don't want to have more than 2 columns here.
--half-width: calc(50% - var(--grid-gap) / 2);
// A column should be at least 128px wide, but can grow to fill the available space to ensure we don't create more than 2 columns.
--min-column-width: max(var(--half-width), 128px);
// We want to fit 1 or 2 columns into the available space, depending on available width.
grid-template-columns: repeat(
auto-fit,
minmax(var(--min-column-width), 1fr)
);

margin-top: 16px;
li {
list-style: none;
Expand All @@ -108,6 +123,11 @@
a {
color: $blue-90;
font-weight: bold;

.icon {
display: inline-block;
width: 25px;
}
}
svg {
margin-right: 8px;
Expand Down
2 changes: 1 addition & 1 deletion site/gdocs/pages/Homepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const SocialSection = () => {
</section>
<section className="homepage-social-ribbon__social-media span-cols-4 span-sm-cols-12 col-sm-start-2">
<h2 className="h2-semibold">Follow us</h2>
<ul className="homepage-social-ribbon__social-list grid grid-cols-2 grid-md-cols-1">
<ul className="homepage-social-ribbon__social-list grid">
{[...SOCIALS, ...RSS_FEEDS].map(({ title, url, icon }) => (
<li key={title}>
<a
Expand Down

0 comments on commit a40f02c

Please sign in to comment.