Skip to content

Commit 4b9fea0

Browse files
committed
Improve styles
1 parent dfe67af commit 4b9fea0

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

src/components/learn-aggregator/index.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import ArrowDownIcon from "@/app/conf/_design-system/pixelarticons/arrow-down.sv
77
import blurBean from "./learn-blur-bean.webp"
88
import clsx from "clsx"
99

10-
export interface TeaserSectionProps {
10+
export interface TeaserSectionProps
11+
extends React.HTMLAttributes<HTMLDivElement> {
1112
eyebrow: string
1213
title: string
1314
description: string
@@ -28,10 +29,18 @@ export function TeaserSection({
2829
cta,
2930
items,
3031
firstIconsEager,
32+
className,
33+
...rest
3134
}: TeaserSectionProps) {
3235
return (
33-
<div className="flex items-start gap-8 max-lg:flex-col lg:gap-12 xl:gap-16">
34-
<header className="flex max-w-[720px] flex-col gap-6 text-left">
36+
<section
37+
className={clsx(
38+
"gql-container gql-section flex items-start gap-8 max-lg:flex-col lg:gap-12 xl:gap-16",
39+
className,
40+
)}
41+
{...rest}
42+
>
43+
<header className="flex max-w-[720px] flex-col gap-6 pt-6 text-left">
3544
<div className="flex flex-col gap-6">
3645
<Eyebrow>{eyebrow}</Eyebrow>
3746
<h2 className="typography-h2 text-pretty text-neu-900">{title}</h2>
@@ -41,7 +50,7 @@ export function TeaserSection({
4150
{cta}
4251
</div>
4352
</header>
44-
<ul className="gap-4 lg:gap-8">
53+
<ul className="flex flex-col gap-4 lg:gap-8">
4554
{items.map((item, index) => {
4655
return (
4756
<TeaserSectionListItem
@@ -65,7 +74,7 @@ export function TeaserSection({
6574
)
6675
})}
6776
</ul>
68-
</div>
77+
</section>
6978
)
7079
}
7180

@@ -91,7 +100,7 @@ function TeaserSectionListItem({
91100
<li className="text-neu-900">
92101
<a
93102
href={href}
94-
className="gql-focus-visible grid gap-x-3 gap-y-4 border border-neu-200 bg-neu-0 p-4 transition-colors [grid-template-areas:'icon_header''desc_desc'] [grid-template-columns:72px_1fr] [grid-template-rows:auto_auto] hover:border-neu-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 lg:gap-x-6 lg:gap-y-4 lg:p-0 lg:[grid-template-areas:'icon_header_arrow''icon_desc_arrow'] lg:[grid-template-columns:190px_1fr_64px]"
103+
className="gql-focus-visible grid border border-neu-200 bg-neu-0 transition-colors [grid-template-areas:'icon_header''desc_desc'] [grid-template-columns:72px_1fr] [grid-template-rows:auto_auto] hover:border-neu-300 hover:ring hover:ring-neu-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 dark:hover:ring-neu-50 lg:[grid-template-areas:'icon_header_arrow''icon_desc_arrow'] lg:[grid-template-columns:190px_1fr_64px]"
95104
>
96105
<div
97106
className={clsx(
@@ -105,7 +114,7 @@ function TeaserSectionListItem({
105114
{icon}
106115
</div>
107116

108-
<div className="flex flex-col gap-1 [grid-area:header] lg:gap-2 lg:px-4 lg:pt-4">
117+
<div className="flex flex-col gap-1 [grid-area:header] lg:px-4 lg:pt-4">
109118
<span className="typography-body-sm text-neu-700">
110119
Lesson {number}
111120
</span>
@@ -118,7 +127,7 @@ function TeaserSectionListItem({
118127
{description}
119128
</p>
120129

121-
<div className="hidden items-center justify-center border-l border-t border-neu-200 [grid-area:arrow] lg:flex">
130+
<div className="hidden items-center justify-center place-self-end border-l border-t border-neu-200 p-4 [grid-area:arrow] lg:flex">
122131
<ArrowDownIcon className="size-8 shrink-0 -rotate-90" />
123132
</div>
124133
</a>
@@ -131,7 +140,7 @@ export function LearnHeroStripes() {
131140
<div
132141
role="presentation"
133142
// eslint-disable-next-line tailwindcss/no-contradicting-classname
134-
className="pointer-events-none absolute inset-0 h-[480px] bg-neu-50 [--end-1:#FFF] [--end-2:rgb(255_204_239/.2)] [--start-1:#FFEAF8] [--start-2:hsl(var(--color-sec-lighter))] dark:[--end-1:hsl(var(--color-neu-0))] dark:[--start-1:hsl(var(--color-neu-100))]"
143+
className="pointer-events-none absolute inset-0 h-[300px] bg-neu-50 [--end-1:#FFF] [--end-2:rgb(255_204_239/.2)] [--start-1:#FFEAF8] [--start-2:hsl(var(--color-sec-lighter))] dark:[--end-1:hsl(var(--color-neu-0))] dark:[--start-1:hsl(var(--color-neu-100))] sm:h-[360px] lg:h-[480px]"
135144
style={{
136145
maskImage: `url(${blurBean.src})`,
137146
WebkitMaskImage: `url(${blurBean.src})`,

src/components/learn-aggregator/learn-pages.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const _items: Record<
1717
introduction: {
1818
description:
1919
"Get a high-level overview of GraphQL and how it enables flexible, versionless APIs powered by a strong type system.",
20-
icon: new URL("./icons/computer.svg", import.meta.url).href,
20+
icon: new URL("./icons/computer.svg?raw", import.meta.url).href,
2121
section: "getting-started",
2222
},
2323
schema: {

src/pages/learn/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { NavbarFixed } from '../../components/navbar/navbar-fixed'
2727
</TocHero>
2828

2929
<TeaserSection
30+
id="learn-graphql"
3031
eyebrow="Learn GraphQL"
3132
title="Getting started with GraphQL"
3233
description=
@@ -40,7 +41,8 @@ import { NavbarFixed } from '../../components/navbar/navbar-fixed'
4041
items={pagesBySection["getting-started"]}
4142
/>
4243

43-
<TeaserSection
44+
<TeaserSection
45+
id="best-practices"
4446
eyebrow="Best practices"
4547
title="Practical guidelines"
4648
description=

0 commit comments

Comments
 (0)