Skip to content

Commit 95b1067

Browse files
authored
Merge pull request #14940 from TylerAPfledderer/refactor/tailwind-max-w-screens
refactor(tailwind): apply `max-width-screen-*` usage
2 parents a53023c + 8781434 commit 95b1067

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

src/components/Hero/HubHero/HubHero.stories.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { useTranslations } from "next-intl"
2-
import type { CSSProperties } from "react"
3-
import { Meta, StoryObj } from "@storybook/react"
4-
5-
import { screens } from "@/lib/utils/screen"
2+
import type { Meta, StoryObj } from "@storybook/react/*"
63

74
import { langViewportModes } from "@/storybook/modes"
85

@@ -23,10 +20,7 @@ const meta = {
2320
},
2421
decorators: [
2522
(Story) => (
26-
<div
27-
style={{ "--hero-decorator-max-w": screens["2xl"] } as CSSProperties}
28-
className="mx-auto max-w-[var(--hero-decorator-max-w)]"
29-
>
23+
<div className="mx-auto max-w-screen-2xl">
3024
<Story />
3125
</div>
3226
),

src/components/Hero/MdxHero/MdxHero.stories.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import type { CSSProperties } from "react"
21
import { Meta, StoryObj } from "@storybook/react"
32

43
import { HStack } from "@/components/ui/flex"
54

6-
import { screens } from "@/lib/utils/screen"
7-
85
import { langViewportModes } from "@/storybook/modes"
96

107
import MdxHeroComponent from "./"
@@ -22,10 +19,7 @@ const meta = {
2219
},
2320
decorators: [
2421
(Story) => (
25-
<HStack
26-
style={{ "--hero-decorator-max-w": screens["2xl"] } as CSSProperties}
27-
className="mx-auto h-[100vh] max-w-[var(--hero-decorator-max-w)]"
28-
>
22+
<HStack className="mx-auto h-[100vh] max-w-screen-2xl">
2923
<Story />
3024
</HStack>
3125
),

src/components/ui/__stories__/Table/Table.stories.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import type { CSSProperties } from "react"
21
import { Meta, StoryObj } from "@storybook/react"
32

4-
import { screens } from "@/lib/utils/screen"
5-
63
import { Flex } from "../../flex"
74
import { Table as TableComponent } from "../../table"
85

@@ -17,10 +14,7 @@ const meta = {
1714
component: TableComponent,
1815
decorators: [
1916
(Story) => (
20-
<Flex
21-
style={{ "--table-decorator-max-w": screens["md"] } as CSSProperties}
22-
className="max-w-[var(--table-decorator-max-w)] flex-col gap-16"
23-
>
17+
<Flex className="max-w-screen-md flex-col gap-16">
2418
<Story />
2519
</Flex>
2620
),

src/pages/[locale]/roadmap/vision.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { GetStaticProps } from "next"
2-
import type {
3-
ComponentProps,
4-
ComponentPropsWithRef,
5-
CSSProperties,
6-
} from "react"
2+
import type { ComponentProps, ComponentPropsWithRef } from "react"
73

84
import type { BasePageProps, ChildOnlyProp, Lang, Params } from "@/lib/types"
95

@@ -27,7 +23,6 @@ import { List, ListItem } from "@/components/ui/list"
2723
import { cn } from "@/lib/utils/cn"
2824
import { existsNamespace } from "@/lib/utils/existsNamespace"
2925
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
30-
import { screens } from "@/lib/utils/screen"
3126
import { getLocaleTimestamp } from "@/lib/utils/time"
3227
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
3328

@@ -81,13 +76,7 @@ const CardContainer = ({ className, ...props }: FlexProps) => (
8176
)
8277

8378
const ProblemCardContainer = (props: ChildOnlyProp) => {
84-
return (
85-
<CardContainer
86-
style={{ "--container-max-w": screens.lg } as CSSProperties}
87-
className="mx-auto max-w-[var(--container-max-w)]"
88-
{...props}
89-
/>
90-
)
79+
return <CardContainer className="mx-auto max-w-screen-lg" {...props} />
9180
}
9281

9382
const CentreCard = (props: ComponentPropsWithRef<typeof Card>) => (

0 commit comments

Comments
 (0)