Skip to content

Commit

Permalink
Nudge responsive layout
Browse files Browse the repository at this point in the history
  • Loading branch information
timuric committed Jul 10, 2024
1 parent 08be21a commit 702e322
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 50 deletions.
88 changes: 45 additions & 43 deletions components/Apps/Apps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,51 @@ const Shell = ({ color, title, children, href = "" }) => {
};
const Apps = () => {
return (
<div className={s.container}>
<Shell color={"rgb(10, 191, 83)"} title={"Adyen"}>
<Adyen />
</Shell>
<Shell color={"rgb(223, 110, 44)"} title={"Avatax"}>
<Taxes />
</Shell>
<Shell color={"rgb(39, 180, 118)"} title={"CMS"}>
<CMS />
</Shell>
<Shell color={"rgb(137, 82, 255)"} title={"CRM"}>
<CRM />
</Shell>
<Shell color={"rgb(59, 213, 121)"} title={"Data importer"}>
<Data />
</Shell>
<Shell color={"rgb(227, 149, 60)"} title={"Invoices"}>
<Invoices />
</Shell>
<Shell color={"rgb(58, 86, 199)"} title={"Klaviyo"}>
<Placeholder />
</Shell>{" "}
<Shell color={"rgb(122, 150, 176)"} title={"Product Feed"}>
<ProductFeed />
</Shell>
<Shell color={"rgb(199, 58, 63)"} title={"Search"}>
<Search />
</Shell>
<Shell color={"rgb(37, 195, 101)"} title={"Twilio Segment"}>
<Segment />
</Shell>
<Shell color={"rgb(95, 58, 199)"} title={"Slack"}>
<Placeholder />
</Shell>
<Shell color={"rgb(199, 159, 58)"} title={"SMTP"}>
<Notification />
</Shell>
<Shell color={"rgb(99, 91, 255)"} title={"Stipe"}>
<Stripe />
</Shell>
<Shell color={"rgb(86, 189, 104)"} title={"Taxjar"}>
<TaxJar />
</Shell>
<div className={s.root}>
<div className={s.container}>
<Shell color={"rgb(10, 191, 83)"} title={"Adyen"}>
<Adyen />
</Shell>
<Shell color={"rgb(223, 110, 44)"} title={"Avatax"}>
<Taxes />
</Shell>
<Shell color={"rgb(39, 180, 118)"} title={"CMS"}>
<CMS />
</Shell>
<Shell color={"rgb(137, 82, 255)"} title={"CRM"}>
<CRM />
</Shell>
<Shell color={"rgb(59, 213, 121)"} title={"Data importer"}>
<Data />
</Shell>
<Shell color={"rgb(227, 149, 60)"} title={"Invoices"}>
<Invoices />
</Shell>
<Shell color={"rgb(58, 86, 199)"} title={"Klaviyo"}>
<Placeholder />
</Shell>{" "}
<Shell color={"rgb(122, 150, 176)"} title={"Product Feed"}>
<ProductFeed />
</Shell>
<Shell color={"rgb(199, 58, 63)"} title={"Search"}>
<Search />
</Shell>
<Shell color={"rgb(37, 195, 101)"} title={"Twilio Segment"}>
<Segment />
</Shell>
<Shell color={"rgb(95, 58, 199)"} title={"Slack"}>
<Placeholder />
</Shell>
<Shell color={"rgb(199, 159, 58)"} title={"SMTP"}>
<Notification />
</Shell>
<Shell color={"rgb(99, 91, 255)"} title={"Stipe"}>
<Stripe />
</Shell>
<Shell color={"rgb(86, 189, 104)"} title={"Taxjar"}>
<TaxJar />
</Shell>
</div>
</div>
);
};
Expand Down
9 changes: 9 additions & 0 deletions components/Apps/apps.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.root {
container-type: inline-size;
}
.container {
--hover-color: var(--gray12);
display: grid;
Expand All @@ -6,6 +9,12 @@
flex-wrap: wrap;
}

@container (width < 500px) {
.container {
grid-template-columns: repeat(2, minmax(200px, 1fr));
}
}

.app {
font-size: var(--font-size-sm);
font-weight: 600;
Expand Down
2 changes: 1 addition & 1 deletion components/Block/block.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
grid-column: 4 / -1;
}

@container (width < 800px) {
@container (width < 850px) {
.root h2 {
grid-column: 1 / 12;
}
Expand Down
14 changes: 8 additions & 6 deletions components/Chapters/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import React from "react";
import s from "./styles.module.css";

const Chapters = ({ children, home = false }) => (
<section className={s.grid}>
{"map" in children ? (
children.map((child, idx) => <article key={idx}>{child}</article>)
) : (
<article>{children}</article>
)}
<section className={s.root}>
<div className={s.grid}>
{"map" in children ? (
children.map((child, idx) => <article key={idx}>{child}</article>)
) : (
<article>{children}</article>
)}
</div>
</section>
);

Expand Down
16 changes: 16 additions & 0 deletions components/Chapters/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
.root {
container-type: inline-size;
}

.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--spacer-5);
}

@container (width < 600px) {
.grid {
grid-template-columns: repeat(2, minmax(100px, 200px));
}
}

@container (width < 200px) {
.grid {
grid-template-columns: repeat(1, minmax(100px, 200px));
}
}

.grid p {
margin: 0;
}
Expand Down

0 comments on commit 702e322

Please sign in to comment.