Skip to content

Commit 4fee598

Browse files
committed
style: centered last button
1 parent 91abc74 commit 4fee598

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

components/Card.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ function Card({ repo }: Props) {
6161
</div>
6262

6363
{/* stars and forks cards */}
64-
<div className="flex flex-wrap gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
64+
<div className="container-query flex flex-wrap justify-between gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6565
<a
6666
href={`${repo.html_url}/stargazers`}
6767
target="_blank"
68-
className="group w-full flex-shrink-0 flex-grow-1 mx-auto basis-[120px] border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
68+
className="group w-full flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
6969
>
7070
<GoStar className="text-yellow-200 text-2xl" />
7171
<div className="flex flex-col">
@@ -84,7 +84,7 @@ function Card({ repo }: Props) {
8484
<a
8585
href={`${repo.html_url}/forks`}
8686
target="_blank"
87-
className="group flex-shrink-0 flex-grow-1 mx-auto basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
87+
className="group flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
8888
>
8989
<GoRepoForked className="text-yellow-200 text-2xl" />
9090
<div className="flex flex-col">
@@ -103,7 +103,7 @@ function Card({ repo }: Props) {
103103
<a
104104
href={`${repo.html_url}/issues`}
105105
target="_blank"
106-
className="group flex-shrink-0 flex-grow-1 mx-auto basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
106+
className="group issues-btn flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
107107
>
108108
<GoIssueOpened className="text-yellow-200 text-2xl" />
109109
<div className="flex flex-col">

styles/globals.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,18 @@ a {
7070
);
7171
border-radius: 2px;
7272
}
73+
74+
.container-query {
75+
container-type: inline-size;
76+
}
77+
78+
@container (max-width: 383px) {
79+
.issues-btn {
80+
margin-inline: auto;
81+
}
82+
}
83+
@container (max-width: 251px) {
84+
.issues-btn {
85+
margin-inline: 0;
86+
}
87+
}

0 commit comments

Comments
 (0)