Skip to content

Commit 031f511

Browse files
committed
Use branded GitHub and npm buttons
1 parent 6732d66 commit 031f511

5 files changed

Lines changed: 110 additions & 2 deletions

File tree

apps/frontend/app/globals.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,35 @@ pre {
152152
gap: 0.8rem;
153153
}
154154

155+
.repo-button-badge {
156+
display: inline-grid;
157+
place-items: center;
158+
min-width: 34px;
159+
height: 34px;
160+
padding: 0 0.35rem;
161+
border-radius: 999px;
162+
background: rgba(255, 255, 255, 0.1);
163+
}
164+
165+
.repo-button-badge-npm {
166+
background: rgba(255, 255, 255, 0.14);
167+
}
168+
169+
.button-brand-icon {
170+
display: block;
171+
}
172+
173+
.button-brand-icon-github {
174+
width: 16px;
175+
height: 16px;
176+
color: #ffffff;
177+
}
178+
179+
.button-brand-icon-npm {
180+
width: 30px;
181+
height: 12px;
182+
}
183+
155184
.repo-button {
156185
display: inline-flex;
157186
align-items: center;
@@ -289,6 +318,7 @@ pre {
289318
display: inline-flex;
290319
align-items: center;
291320
justify-content: center;
321+
gap: 0.55rem;
292322
min-height: 48px;
293323
padding: 0 1.15rem;
294324
border-radius: 999px;
@@ -323,6 +353,21 @@ pre {
323353
box-shadow: 0 16px 32px rgba(203, 56, 55, 0.22);
324354
}
325355

356+
.button-inline-icon {
357+
flex: none;
358+
display: block;
359+
}
360+
361+
.button-inline-icon-github {
362+
width: 16px;
363+
height: 16px;
364+
}
365+
366+
.button-inline-icon-npm {
367+
width: 30px;
368+
height: 12px;
369+
}
370+
326371
.hero-proof {
327372
display: flex;
328373
flex-wrap: wrap;
@@ -1151,12 +1196,28 @@ pre {
11511196
display: inline-flex;
11521197
align-items: center;
11531198
justify-content: center;
1199+
gap: 0.6rem;
11541200
min-height: 46px;
11551201
padding: 0 1rem;
11561202
border-radius: 999px;
11571203
font-weight: 800;
11581204
}
11591205

1206+
.footer-button-icon {
1207+
flex: none;
1208+
display: block;
1209+
}
1210+
1211+
.footer-button-icon-github {
1212+
width: 16px;
1213+
height: 16px;
1214+
}
1215+
1216+
.footer-button-icon-npm {
1217+
width: 30px;
1218+
height: 12px;
1219+
}
1220+
11601221
.footer-button-primary {
11611222
background: linear-gradient(135deg, #0f8d67, #0b6c54);
11621223
color: white;

apps/frontend/app/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getProjectMeta } from "../lib/project-meta";
22
import Link from "next/link";
33

4+
import { GitHubMarkIcon, NpmWordmarkIcon } from "../components/brand-icons";
45
import { siteConfig } from "../lib/site-config";
56
import { docs } from "../lib/site";
67

@@ -39,11 +40,13 @@ export default async function HomePage() {
3940
</Link>
4041
{siteConfig.repoConfigured ? (
4142
<a className="button button-tertiary" href={siteConfig.repoUrl ?? undefined} target="_blank" rel="noreferrer">
43+
<GitHubMarkIcon className="button-inline-icon button-inline-icon-github" />
4244
Go to Repo
4345
</a>
4446
) : null}
4547
{siteConfig.npmConfigured ? (
4648
<a className="button button-npm" href={siteConfig.npmUrl ?? undefined} target="_blank" rel="noreferrer">
49+
<NpmWordmarkIcon className="button-inline-icon button-inline-icon-npm" />
4750
npm Package
4851
</a>
4952
) : null}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export function GitHubMarkIcon({ className = "" }: { className?: string }) {
2+
return (
3+
<svg
4+
viewBox="0 0 24 24"
5+
aria-hidden="true"
6+
className={className}
7+
fill="currentColor"
8+
xmlns="http://www.w3.org/2000/svg"
9+
>
10+
<path d="M12 .296C5.373.296 0 5.67 0 12.295c0 5.303 3.438 9.8 8.205 11.387.6.111.82-.26.82-.578 0-.286-.01-1.044-.016-2.05-3.338.726-4.042-1.61-4.042-1.61-.546-1.386-1.333-1.755-1.333-1.755-1.089-.744.083-.729.083-.729 1.205.085 1.84 1.237 1.84 1.237 1.07 1.833 2.809 1.304 3.495.997.108-.775.42-1.305.763-1.605-2.665-.303-5.467-1.333-5.467-5.93 0-1.31.467-2.381 1.235-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.267 1.984-.4 3.004-.404 1.02.004 2.047.137 3.006.404 2.29-1.552 3.296-1.23 3.296-1.23.655 1.653.244 2.874.12 3.176.77.84 1.233 1.911 1.233 3.22 0 4.61-2.807 5.624-5.48 5.921.431.372.815 1.104.815 2.226 0 1.607-.014 2.904-.014 3.299 0 .321.216.694.825.576C20.565 22.09 24 17.594 24 12.295 24 5.67 18.627.296 12 .296Z" />
11+
</svg>
12+
);
13+
}
14+
15+
export function NpmWordmarkIcon({ className = "" }: { className?: string }) {
16+
return (
17+
<svg
18+
viewBox="0 0 64 24"
19+
aria-hidden="true"
20+
className={className}
21+
fill="none"
22+
xmlns="http://www.w3.org/2000/svg"
23+
>
24+
<rect x="0.75" y="3.25" width="62.5" height="17.5" rx="2.75" fill="#CB3837" stroke="rgba(255,255,255,0.18)" strokeWidth="1.5" />
25+
<path d="M8 8H20V16H24V8H32V16H36V12H40V16H44V8H56V12H52V16H48V12H44V16H40V12H36V8H28V16H24V12H20V16H8V8Z" fill="white" />
26+
</svg>
27+
);
28+
}

apps/frontend/components/footer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from "next/link";
22

33
import { siteConfig } from "../lib/site-config";
4+
import { GitHubMarkIcon, NpmWordmarkIcon } from "./brand-icons";
45

56
export function Footer() {
67
const repoConfigured = siteConfig.repoConfigured;
@@ -41,6 +42,7 @@ export function Footer() {
4142
target="_blank"
4243
rel="noreferrer"
4344
>
45+
<GitHubMarkIcon className="footer-button-icon footer-button-icon-github" />
4446
{siteConfig.repoLabel}
4547
</a>
4648
) : (
@@ -59,6 +61,7 @@ export function Footer() {
5961
target="_blank"
6062
rel="noreferrer"
6163
>
64+
<NpmWordmarkIcon className="footer-button-icon footer-button-icon-npm" />
6265
{siteConfig.npmLabel}
6366
</a>
6467
) : (

apps/frontend/components/header.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from "next/link";
22

33
import { siteConfig } from "../lib/site-config";
4+
import { GitHubMarkIcon, NpmWordmarkIcon } from "./brand-icons";
45
import { Logo } from "./logo";
56

67
export function Header() {
@@ -34,11 +35,17 @@ export function Header() {
3435
target="_blank"
3536
rel="noreferrer"
3637
>
38+
<span className="repo-button-badge" aria-hidden="true">
39+
<GitHubMarkIcon className="button-brand-icon button-brand-icon-github" />
40+
</span>
3741
<span>{siteConfig.repoLabel}</span>
3842
<span className="repo-button-icon" aria-hidden="true"></span>
3943
</a>
4044
) : (
4145
<span className="repo-button repo-button-disabled" aria-disabled="true" title="Set NEXT_PUBLIC_REPO_URL to enable this button.">
46+
<span className="repo-button-badge" aria-hidden="true">
47+
<GitHubMarkIcon className="button-brand-icon button-brand-icon-github" />
48+
</span>
4249
<span>{siteConfig.repoLabel}</span>
4350
<span className="repo-button-icon" aria-hidden="true"></span>
4451
</span>
@@ -51,13 +58,19 @@ export function Header() {
5158
target="_blank"
5259
rel="noreferrer"
5360
>
61+
<span className="repo-button-badge repo-button-badge-npm" aria-hidden="true">
62+
<NpmWordmarkIcon className="button-brand-icon button-brand-icon-npm" />
63+
</span>
5464
<span>{siteConfig.npmLabel}</span>
55-
<span className="repo-button-icon npm-button-icon" aria-hidden="true">N</span>
65+
<span className="repo-button-icon npm-button-icon" aria-hidden="true"></span>
5666
</a>
5767
) : (
5868
<span className="repo-button repo-button-disabled npm-button" aria-disabled="true" title="Set NEXT_PUBLIC_NPM_URL to enable this button.">
69+
<span className="repo-button-badge repo-button-badge-npm" aria-hidden="true">
70+
<NpmWordmarkIcon className="button-brand-icon button-brand-icon-npm" />
71+
</span>
5972
<span>{siteConfig.npmLabel}</span>
60-
<span className="repo-button-icon npm-button-icon" aria-hidden="true">N</span>
73+
<span className="repo-button-icon npm-button-icon" aria-hidden="true"></span>
6174
</span>
6275
)}
6376
</div>

0 commit comments

Comments
 (0)