Skip to content

Commit 26dbcd1

Browse files
refactor(Heading.stories): migrate to tailwind
1 parent a935686 commit 26dbcd1

File tree

4 files changed

+85
-92
lines changed

4 files changed

+85
-92
lines changed

src/components/Heading/Heading.stories.tsx

Lines changed: 0 additions & 91 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import * as React from "react"
2+
import { Meta, StoryObj } from "@storybook/react"
3+
4+
import { Center, Stack } from "../flex"
5+
6+
const meta = {
7+
title: "Atoms / Typography / Heading",
8+
parameters: {
9+
layout: null,
10+
chromatic: {
11+
modes: {
12+
md: {
13+
viewport: "md",
14+
},
15+
"2xl": {
16+
viewport: "2xl",
17+
},
18+
},
19+
},
20+
},
21+
decorators: [
22+
(Story) => (
23+
<Center className='flex-col min-h-[100vh]'>
24+
<Story />
25+
</Center>
26+
),
27+
],
28+
} satisfies Meta
29+
30+
export default meta
31+
32+
type Story = StoryObj<typeof meta>
33+
34+
const headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const
35+
36+
export const Heading: Story = {
37+
render: () => (
38+
<>
39+
<div>
40+
Adjust the viewport to below &quot;md&quot; to see the font size and
41+
line height change
42+
</div>
43+
<Stack>
44+
{headings.map((Heading) => (
45+
<Heading key={Heading}>
46+
{`${Heading} base component`}
47+
</Heading>
48+
))}
49+
</Stack>
50+
</>
51+
),
52+
}

src/components/ui/flex.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Center = forwardRef<FlexElement, FlexProps>(
2222
return (
2323
<Flex
2424
ref={ref}
25-
className={cn("items-center justify-center", className)}
25+
className={cn("items-center justify-center gap-2", className)}
2626
{...props}
2727
/>
2828
)

src/styles/global.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
@layer base {
66
:root {
7+
8+
--font-inter: Inter, sans-serif;
9+
--font-mono: "IBM Plex Mono", Courier, monospace;
10+
711
/* Primitive Color Scheme */
812
--gray-100: #f7f7f7;
913
--gray-150: #f2f2f2;
@@ -149,6 +153,34 @@
149153
@apply text-primary underline;
150154
}
151155

156+
h1, h2, h3, h4, h5, h6 {
157+
@apply font-bold
158+
}
159+
160+
h1 {
161+
@apply text-4xl lg:text-5xl;
162+
}
163+
164+
h2 {
165+
@apply text-3xl lg:text-4xl;
166+
}
167+
168+
h3 {
169+
@apply text-2xl lg:text-3xl;
170+
}
171+
172+
h4 {
173+
@apply text-xl lg:text-2xl;
174+
}
175+
176+
h5 {
177+
@apply text-md lg:text-xl;
178+
}
179+
180+
h6 {
181+
@apply text-sm lg:text-md;
182+
}
183+
152184
/* TODO: to be replaced with list component styles */
153185
ul,
154186
ol {

0 commit comments

Comments
 (0)