Skip to content

Commit 3567664

Browse files
committed
WIP
1 parent 8466f87 commit 3567664

File tree

6 files changed

+62
-13
lines changed

6 files changed

+62
-13
lines changed

next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import withLess from "next-with-less"
66
import fs from "fs"
77

88
import { remarkGraphiQLComment } from "./src/remark-graphiql-comment.js"
9+
import { syntaxHighlightingThemes } from "./src/_design-system/syntax/index.js"
910

1011
const vercelJSON = JSON.parse(fs.readFileSync("./vercel.json", "utf-8"))
1112

@@ -15,6 +16,9 @@ const withNextra = nextra({
1516
themeConfig: "./theme.config.tsx",
1617
mdxOptions: {
1718
remarkPlugins: [remarkGraphiQLComment],
19+
rehypePrettyCodeOptions: {
20+
theme: syntaxHighlightingThemes,
21+
},
1822
},
1923
})
2024

src/components/index-page/graphql-advantages/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function GraphQLAdvantages() {
99
<section className="bg-neu-50 dark:bg-neu-50/25">
1010
<div className="gql-container gql-section">
1111
<SectionLabel>GraphQL advantages</SectionLabel>
12-
<div className="mt-8 flex flex-col gap-y-10">
12+
<div className="mt-8 flex flex-col gap-y-10 lg:gap-y-16 xl:gap-y-24">
1313
<Subsection
1414
name="Precision"
1515
bigText="Ask for what you need, get exactly that"
@@ -99,16 +99,18 @@ function Subsection({
9999
text: ReactNode
100100
}) {
101101
return (
102-
<article className="grid lg:grid-cols-2 lg:*:[grid-column:1]">
103-
<h3 className="typography-body-sm w-min items-center justify-center bg-sec-light px-1 py-[1.5px] font-normal dark:bg-sec-darker">
102+
<article className="grid gap-x-4 lg:grid-cols-2 lg:*:[grid-column:1] xl:gap-x-12">
103+
<h3 className="typography-body-sm size-min items-center justify-center bg-sec-light px-1 py-[1.5px] font-normal dark:bg-sec-darker">
104104
{name}
105105
</h3>
106106
<strong className="typography-h3 mt-4 font-normal lg:mt-8">
107107
{bigText}
108108
</strong>
109-
<div className="max-lg:mt-6 lg:![grid-column:2]">{figure}</div>
109+
<div className="flex max-lg:mt-6 max-sm:-mx-4 lg:row-start-1 lg:row-end-5 lg:![grid-column:2]">
110+
{figure}
111+
</div>
110112
<p className="typography-body-lg my-6 lg:mb-4 lg:mt-8">{text}</p>
111-
<div>{cta}</div>
113+
<div className="self-end lg:justify-self-start">{cta}</div>
112114
</article>
113115
)
114116
}

src/components/index-page/graphql-advantages/precision.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const components = {
1010
pre: (props: ComponentPropsWithoutRef<typeof Pre>) => (
1111
<Pre
1212
{...props}
13-
className={clsx(props.className, "!bg-neu-0/[.48]")}
13+
// todo: this bg style might need to become global for all code blocks
14+
className={clsx(
15+
props.className,
16+
"!bg-neu-0/[.48] pr-4 backdrop-blur-[6px] max-xs:[&_span]:!text-xs",
17+
)}
1418
tabIndex={-1}
1519
/>
1620
),
@@ -87,21 +91,24 @@ export function PrecisionFigure() {
8791
<div
8892
ref={ref}
8993
id="predictable-results"
90-
className="nextra-codeblocks flex bg-gradient-to-b from-transparent to-sec-lighter px-[14px] py-[30px] *:w-1/2 dark:to-sec-darker/25 [&_pre]:!h-48"
94+
className="nextra-codeblocks flex w-full bg-gradient-to-b from-transparent to-sec-lighter px-[14px] py-[30px] *:w-1/2 dark:to-sec-darker/25 xl:px-[46px] [&_pre]:!h-48"
9195
aria-hidden
9296
>
9397
<Pre data-filename="Query" className="p-4">
9498
{"{"}
95-
{"\n hero {"}
96-
{"\n name"}
99+
{"\n "}
100+
{/* todo: change this color to brand colors globally */}
101+
<span className="!text-pri-base">{"hero"}</span>
102+
{" {"}
103+
<span className="!text-pri-base">{"\n name"}</span>
97104
{"\n height\n mass".split("").map((char, i) => (
98-
<span key={i} id={"ch" + i} className="hidden">
105+
<span key={i} id={"ch" + i} className="hidden !text-pri-base">
99106
{char === "\n" ? <br /> : char}
100107
</span>
101108
))}
102109
<span
103110
className={clsx(
104-
"-mb-0.5 ml-px inline-block h-4 w-2 !bg-pri-base/50 dark:!bg-sec-base/50",
111+
"-mb-0.5 ml-px inline-block h-4 w-2 !bg-pri-base/50 dark:!bg-pri-light/60",
105112
classes.cursor,
106113
)}
107114
/>

src/components/index-page/how-it-works.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function ListItem({
3535
<div className="typography-body-md bg-neu-0 py-4 before:typography-body-sm before:mr-2 before:inline-flex before:size-5 before:translate-y-[-0.5px] before:items-center before:justify-center before:bg-neu-200 before:p-1 before:text-neu-800 before:content-[counter(list-item)] dark:before:bg-neu-50 md:py-6 md:before:ml-6">
3636
{text}
3737
</div>
38-
<div className="mt-px bg-neu-0 md:pl-2 md:pt-2 max-md:[&_code>span]:!pl-0 [&_pre]:ring-0">
38+
<div className="mt-px bg-neu-0 md:pl-2 md:pt-2 max-md:[&_code>span]:!pl-0 [&_pre]:border-none [&_pre]:ring-0">
3939
{code}
4040
</div>
4141
</li>

src/nextra-theme-docs.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,3 +2994,39 @@ body.nextra-banner-hidden .\[body\.nextra-banner-hidden_\&\]\:_hidden {
29942994
div:hover > .\[div\:hover\>\&\]\:_opacity-100 {
29952995
opacity: 1;
29962996
}
2997+
2998+
/* code blocks */
2999+
.nextra-code {
3000+
--border-color: hsl(var(--color-neu-200));
3001+
3002+
& ._h-12 {
3003+
height: unset;
3004+
}
3005+
3006+
& > div:first-child /* file name */ {
3007+
padding-top: 8px;
3008+
padding-bottom: 8px;
3009+
color: hsl(var(--color-neu-800));
3010+
font-size: 14px;
3011+
background-color: hsl(var(--color-neu-0) / 0.64);
3012+
backdrop-filter: blur(6px);
3013+
border: 1px solid var(--border-color);
3014+
border-bottom: none;
3015+
}
3016+
}
3017+
3018+
.dark .nextra-code {
3019+
--border-color: hsl(var(--color-neu-50));
3020+
}
3021+
3022+
.nextra-codeblocks div.nextra-code:not(:last-child) > div:first-child {
3023+
border-right: none;
3024+
}
3025+
.nextra-code pre {
3026+
box-shadow: none;
3027+
border: 1px solid var(--border-color);
3028+
}
3029+
.nextra-codeblocks div.nextra-code:not(:last-child) pre {
3030+
border-right: none;
3031+
}
3032+

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
}
2424
]
2525
},
26-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/_design-system/syntax/index.js"],
2727
"exclude": ["node_modules"]
2828
}

0 commit comments

Comments
 (0)