Skip to content

Commit 0eef024

Browse files
Mad-Katjantimon
andauthored
Update docs (#254)
Co-authored-by: Jan Nicklas <j.nicklas@me.com>
1 parent ea744ac commit 0eef024

25 files changed

+1185
-724
lines changed

.github/workflows/docs.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ env:
44
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
55

66
on:
7+
workflow_dispatch:
8+
inputs:
9+
pr_number:
10+
description: "Pull Request Number"
11+
required: true
12+
type: string
713
push:
814
branches:
915
- main
@@ -25,24 +31,26 @@ jobs:
2531
build-and-deploy:
2632
runs-on: ubuntu-latest
2733
steps:
28-
- name: Checkout
34+
- name: Checkout
2935
uses: actions/checkout@v3
36+
with:
37+
ref: ${{ github.event.pull_request.head.sha || github.event.inputs.pr_number && format('refs/pull/{0}/head', github.event.inputs.pr_number) || github.ref }}
3038

3139
- name: Install pnpm
3240
uses: pnpm/action-setup@v4
3341
with:
3442
version: 9.12.3
3543
run_install: false
36-
44+
3745
- name: Install Node.js
3846
uses: actions/setup-node@v3
3947
with:
4048
node-version: 20
4149
cache: "pnpm"
42-
50+
4351
- name: Install node_modules
4452
run: pnpm install
45-
53+
4654
- name: Install Rust
4755
uses: actions-rs/toolchain@v1
4856
with:
@@ -67,15 +75,15 @@ jobs:
6775
- name: Link Vercel project
6876
run: vercel link --yes --token ${{ secrets.VERCEL_TOKEN }}
6977

70-
# Preview deployment (for pull requests and non-main pushes)
78+
# Preview deployment (for pull requests, manual triggers, and non-main pushes)
7179
- name: Pull Vercel environment information (Preview)
72-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
80+
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
7381
run: vercel pull --yes --environment=preview --token ${{ secrets.VERCEL_TOKEN }}
7482
- name: Build project artifacts (Preview)
75-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
83+
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
7684
run: vercel build --token ${{ secrets.VERCEL_TOKEN }}
7785
- name: Deploy to Vercel (Preview)
78-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
86+
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
7987
run: vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}
8088

8189
# Production deployment (for main branch pushes)
@@ -87,4 +95,4 @@ jobs:
8795
run: vercel build --prod --token ${{ secrets.VERCEL_TOKEN }}
8896
- name: Deploy to Vercel (Production)
8997
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
90-
run: vercel deploy --prebuilt --prod --token ${{ secrets.VERCEL_TOKEN }}
98+
run: vercel deploy --prebuilt --prod --token ${{ secrets.VERCEL_TOKEN }}

packages/docs/app/(home)/page.tsx

Lines changed: 228 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,239 @@
1-
import Link from "next/link";
1+
import { breakpoints, colors, theme } from "@/lib/utils/constants.yak";
2+
import { css, keyframes, styled } from "next-yak";
3+
import NextLink from "next/link";
24

35
export default function HomePage() {
46
return (
5-
<main
6-
style={{
7-
display: "flex",
8-
flexDirection: "column",
9-
textAlign: "center",
10-
justifyContent: "center",
11-
maxWidth: "80ch",
12-
margin: "4rem auto",
13-
}}
14-
>
15-
<img
16-
src="/yak-header.png"
17-
height="1024"
18-
width="1024"
19-
alt="Image of yak coding"
20-
/>
21-
<h1
22-
style={{
23-
fontSize: "2rem",
24-
fontWeight: "bold",
25-
margin: "2rem 0 1rem",
26-
}}
7+
<Article>
8+
<div
9+
css={css`
10+
display: flex;
11+
flex-direction: column-reverse;
12+
13+
${breakpoints.md} {
14+
align-items: last baseline;
15+
flex-direction: row;
16+
gap: 4rem;
17+
}
18+
`}
2719
>
28-
Next-Yak
29-
</h1>
30-
<p>
20+
<Title>Next-Yak</Title>
21+
<Image
22+
src="/img/yak-jumping.png"
23+
height="256"
24+
width="256"
25+
alt="Image of yak coding"
26+
/>
27+
</div>
28+
<Description>
3129
A CSS-in-JS solution tailored for Next.js that seamlessly combines the
3230
expressive power of styled-components syntax with efficient build-time
3331
extraction of CSS using Next.js's built-in CSS configuration.
34-
</p>
35-
<div
36-
style={{
37-
display: "flex",
38-
justifyContent: "center",
39-
gap: "4rem",
40-
marginTop: "2rem",
41-
}}
42-
>
43-
<Link
44-
href={"/docs/getting-started"}
45-
style={{
46-
textUnderlineOffset: "2px",
47-
textDecoration: "underline",
48-
}}
49-
>
32+
</Description>
33+
<LinkArea>
34+
<PrimaryLink href={"/docs/getting-started"}>
5035
Get started
51-
</Link>
52-
<Link
53-
href={"https://github.com/jantimon/next-yak"}
54-
style={{
55-
textUnderlineOffset: "2px",
56-
textDecoration: "underline",
57-
}}
58-
>
36+
<Svg
37+
xmlns="http://www.w3.org/2000/svg"
38+
width="24"
39+
height="24"
40+
viewBox="0 0 24 24"
41+
fill="none"
42+
stroke="currentColor"
43+
strokeWidth="2"
44+
strokeLinecap="round"
45+
strokeLinejoin="round"
46+
>
47+
<path d="M14 4.1 12 6" />
48+
<path d="m5.1 8-2.9-.8" />
49+
<path d="m6 12-1.9 2" />
50+
<path d="M7.2 2.2 8 5.1" />
51+
<path d="M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z" />
52+
</Svg>
53+
</PrimaryLink>
54+
<SecondaryLink href={"https://github.com/jantimon/next-yak"}>
5955
Github
60-
</Link>
61-
</div>
62-
</main>
56+
<Svg
57+
xmlns="http://www.w3.org/2000/svg"
58+
width="24"
59+
height="24"
60+
viewBox="0 0 24 24"
61+
fill="none"
62+
stroke="currentColor"
63+
strokeWidth="2"
64+
strokeLinecap="round"
65+
strokeLinejoin="round"
66+
>
67+
<path d="m9 18 6-6-6-6" />
68+
</Svg>
69+
</SecondaryLink>
70+
</LinkArea>
71+
72+
<Subtitle>Features</Subtitle>
73+
<List>
74+
<li>
75+
<EnumTitle>NextJs Compatibility</EnumTitle>
76+
Works smoothly with both React Server and Client Components
77+
</li>
78+
<li>
79+
<EnumTitle>Build-time CSS</EnumTitle>
80+
Reduces load time by handling CSS during the build phase, using
81+
Next.js built-in CSS Modules features
82+
</li>
83+
<li>
84+
<EnumTitle>Lightweight Runtime</EnumTitle>
85+
Operates with minimal impact, simply changing CSS classes without
86+
modifying the CSSOM
87+
</li>
88+
<li>
89+
<EnumTitle>Standard CSS Syntax</EnumTitle>
90+
Write styles in familiar, easy-to-use CSS
91+
</li>
92+
<li>
93+
<EnumTitle>Integrates with Atomic CSS</EnumTitle>
94+
Easily combines with atomic CSS frameworks like Tailwind CSS for more
95+
design options
96+
</li>
97+
<li>
98+
<EnumTitle>No significant build-time overhead</EnumTitle>
99+
Doesn't increase the build time significantly, by only transforming
100+
statically as much as possible without the need to evaluate arbitrary
101+
JavaScript.
102+
</li>
103+
</List>
104+
<video
105+
src="https://github.com/jantimon/next-yak/assets/4113649/f5a220fc-2a0f-46be-a8e7-c855f7faa337"
106+
controls
107+
/>
108+
</Article>
63109
);
64110
}
111+
112+
const Article = styled.article`
113+
display: flex;
114+
flex-direction: column;
115+
justify-content: center;
116+
max-width: 80ch;
117+
margin-inline: auto;
118+
padding: 2rem 1rem;
119+
`;
120+
121+
const Title = styled.h1`
122+
font-size: 5rem;
123+
font-weight: 400;
124+
125+
background: #000;
126+
background: radial-gradient(
127+
circle farthest-corner at top left,
128+
#000 0%,
129+
#333 100%
130+
);
131+
-webkit-background-clip: text;
132+
-webkit-text-fill-color: transparent;
133+
134+
${theme.dark} {
135+
background: #fff;
136+
background: radial-gradient(
137+
circle farthest-corner at top left,
138+
#ffffff 0%,
139+
#cccccc 100%
140+
);
141+
-webkit-background-clip: text;
142+
-webkit-text-fill-color: transparent;
143+
}
144+
`;
145+
146+
const Image = styled.img`
147+
${breakpoints.md} {
148+
transform: scaleX(-1);
149+
}
150+
`;
151+
152+
const Description = styled.p`
153+
margin-block-end: 2rem;
154+
${breakpoints.md} {
155+
margin-block: 1.5rem;
156+
}
157+
`;
158+
159+
const LinkArea = styled.div`
160+
display: flex;
161+
justify-content: center;
162+
gap: 4rem;
163+
`;
164+
165+
const clickScale = keyframes`
166+
from {
167+
transform: scale(1);
168+
}
169+
to {
170+
transform: scale(0.8);
171+
}
172+
`;
173+
174+
const PrimaryLink = styled(NextLink)`
175+
display: inline-flex;
176+
align-items: center;
177+
border-radius: 12px;
178+
padding: 8px;
179+
padding-inline-start: 16px;
180+
${colors.primary};
181+
182+
&:hover svg {
183+
animation: ${clickScale} 0.3s alternate;
184+
animation-timing-function: linear(
185+
0,
186+
0.351 9%,
187+
0.626 18.3%,
188+
0.832 28.1%,
189+
0.909 33.2%,
190+
0.971 38.5%,
191+
1.013 43.3%,
192+
1.043 48.4%,
193+
1.062 53.8%,
194+
1.07 59.5%,
195+
1.063 68.8%,
196+
1.011 90.3%,
197+
1
198+
);
199+
}
200+
`;
201+
202+
const SecondaryLink = styled(NextLink)`
203+
display: inline-flex;
204+
align-items: center;
205+
border-radius: 12px;
206+
padding: 8px;
207+
padding-inline-start: 16px;
208+
${colors.secondary};
209+
210+
&:hover svg {
211+
transform: translateX(4px);
212+
transition: transform 0.15s ease-in-out;
213+
}
214+
`;
215+
216+
const Subtitle = styled.h2`
217+
font-size: 2rem;
218+
font-weight: 400;
219+
margin: 2rem 0 1rem;
220+
text-align: left;
221+
`;
222+
223+
const List = styled.ul`
224+
list-style-type: disc;
225+
margin-left: 2rem;
226+
margin-bottom: 2rem;
227+
228+
& li {
229+
margin-bottom: 1rem;
230+
}
231+
`;
232+
233+
const EnumTitle = styled.div`
234+
font-weight: 600;
235+
`;
236+
237+
const Svg = styled.svg`
238+
height: 0.7lh;
239+
`;

packages/docs/app/docs/[[...slug]]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default async function Page(props: {
2828
components={{
2929
...defaultMdxComponents,
3030
Popup,
31+
// @ts-expect-error - As long as fumadocs didn't update to react 19, this is necessary
3132
PopupContent,
33+
// @ts-expect-error - As long as fumadocs didn't update to react 19, this is necessary
3234
PopupTrigger,
3335
Tabs,
3436
Tab,

packages/docs/app/docs/global.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/docs/app/docs/layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { ReactNode } from "react";
33
import { baseOptions } from "@/app/layout.config";
44
import { source } from "@/lib/source";
55
import "fumadocs-twoslash/twoslash.css";
6-
import "./global.css";
76

87
export default function Layout({ children }: { children: ReactNode }) {
98
return (

packages/docs/app/layout.config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { YakLogo } from "@/components/lazyYakIcon";
1+
import { YakLogo } from "@/components/yakIcon";
22
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
33

44
/**

0 commit comments

Comments
 (0)