Skip to content

Commit 5764e29

Browse files
feat(ui): Add prettier-plugin-tailwindcss to prettier config (#3561)
1 parent 352afca commit 5764e29

File tree

73 files changed

+462
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+462
-319
lines changed

.changeset/violet-paws-shout.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"semi": true,
88
"singleQuote": true,
99
"tabWidth": 2,
10-
"trailingComma": "all"
10+
"trailingComma": "all",
11+
"plugins": ["prettier-plugin-tailwindcss"]
1112
}

integration/templates/elements-next/src/app/globals.css

+14-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,20 @@ body {
2323
body {
2424
color: rgb(var(--foreground-rgb));
2525
background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb));
26-
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell,
27-
Ubuntu, roboto, noto, arial, sans-serif;
26+
font-family:
27+
-apple-system,
28+
BlinkMacSystemFont,
29+
avenir next,
30+
avenir,
31+
segoe ui,
32+
helvetica neue,
33+
helvetica,
34+
Cantarell,
35+
Ubuntu,
36+
roboto,
37+
noto,
38+
arial,
39+
sans-serif;
2840
}
2941

3042
main {

integration/templates/elements-next/src/app/otp/page.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function OTP() {
3030
<SignIn.Root path='/otp'>
3131
<SignIn.Step
3232
name='start'
33-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white text-center shadow-md'
33+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 text-center shadow-md sm:w-96 sm:px-8'
3434
>
3535
<header className='text-center'>
3636
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>OTP Playground</h1>
@@ -52,7 +52,7 @@ export default function OTP() {
5252
>
5353
<Clerk.Label className='text-sm font-medium text-zinc-950'>Segmented OTP Input</Clerk.Label>
5454
<Clerk.Input
55-
className='flex justify-center has-[:disabled]:opacity-50 segmented-otp-wrapper'
55+
className='segmented-otp-wrapper flex justify-center has-[:disabled]:opacity-50'
5656
type='otp'
5757
data-testid='segmented-otp'
5858
render={({ value, status, index }) => {
@@ -61,7 +61,7 @@ export default function OTP() {
6161
data-status={status}
6262
data-testid={`segmented-otp-${index}`}
6363
className={clsx(
64-
'relative flex size-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md',
64+
'border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md',
6565
{
6666
'z-10 ring-2 ring-black ring-offset-black': status === 'cursor' || status === 'selected',
6767
},
@@ -84,7 +84,7 @@ export default function OTP() {
8484
>
8585
<Clerk.Label className='text-sm font-medium text-zinc-950'>Segmented OTP Input (with props)</Clerk.Label>
8686
<Clerk.Input
87-
className='flex justify-center has-[:disabled]:opacity-50 segmented-otp-with-props-wrapper'
87+
className='segmented-otp-with-props-wrapper flex justify-center has-[:disabled]:opacity-50'
8888
type='otp'
8989
data-testid='segmented-otp-with-props'
9090
passwordManagerOffset={4}
@@ -94,7 +94,7 @@ export default function OTP() {
9494
<div
9595
data-status={status}
9696
className={clsx(
97-
'relative flex size-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md',
97+
'border-input relative flex size-10 items-center justify-center border-y border-r text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md',
9898
{
9999
'z-10 ring-2 ring-black ring-offset-black': status === 'cursor' || status === 'selected',
100100
},

integration/templates/elements-next/src/app/page.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from 'next/link';
44

55
function Card({ children, title }: { children: React.ReactNode; title: string }) {
66
return (
7-
<div className='bg-white rounded-lg py-4 px-8'>
7+
<div className='rounded-lg bg-white px-8 py-4'>
88
<h2 className='text-lg font-medium tracking-tight'>{title}</h2>
99
{children}
1010
</div>
@@ -15,7 +15,7 @@ export default function Home() {
1515
return (
1616
<main>
1717
<h1 className='text-2xl font-medium tracking-tight text-zinc-950'>Clerk Elements: Next.js E2E</h1>
18-
<p className='text-md text-zinc-500 mt-2 mb-6'>
18+
<p className='text-md mb-6 mt-2 text-zinc-500'>
1919
Kitchen sink template to test out Clerk Elements in Next.js App Router.
2020
</p>
2121
<div className='grid grid-cols-3 gap-4'>

integration/templates/elements-next/src/app/sign-in/[[...sign-in]]/page.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Button({ children, ...props }: { children: React.ReactNode }) {
1111
return (
1212
<button
1313
type='button'
14-
className='relative w-full rounded-md bg-neutral-600 bg-gradient-to-b from-neutral-500 to-neutral-600 py-1.5 text-sm font-medium text-white shadow-[0_1px_1px_0_theme(colors.white/10%)_inset,0_1px_2.5px_0_theme(colors.black/36%)] outline-none ring-1 ring-inset ring-neutral-600 before:absolute before:inset-0 before:rounded-md before:bg-white/10 before:opacity-0 hover:before:opacity-100 focus-visible:outline-offset-2 focus-visible:outline-neutral-600 active:bg-neutral-600 active:text-white/60 active:before:opacity-0 truncate'
14+
className='relative w-full truncate rounded-md bg-neutral-600 bg-gradient-to-b from-neutral-500 to-neutral-600 py-1.5 text-sm font-medium text-white shadow-[0_1px_1px_0_theme(colors.white/10%)_inset,0_1px_2.5px_0_theme(colors.black/36%)] outline-none ring-1 ring-inset ring-neutral-600 before:absolute before:inset-0 before:rounded-md before:bg-white/10 before:opacity-0 hover:before:opacity-100 focus-visible:outline-offset-2 focus-visible:outline-neutral-600 active:bg-neutral-600 active:text-white/60 active:before:opacity-0'
1515
{...props}
1616
>
1717
{children}
@@ -29,7 +29,7 @@ export default function SignInPage() {
2929
<SignIn.Step
3030
name='start'
3131
data-test-id='sign-in-step-start'
32-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white'
32+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 sm:w-96 sm:px-8'
3333
>
3434
<header className='text-center'>
3535
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Sign in to Clover</h1>
@@ -59,7 +59,7 @@ export default function SignInPage() {
5959
</Clerk.Field>
6060
<Clerk.Field
6161
name='password'
62-
className='opacity-0 h-0 pointer-events-none absolute'
62+
className='pointer-events-none absolute h-0 opacity-0'
6363
>
6464
<Clerk.Input />
6565
</Clerk.Field>
@@ -87,7 +87,7 @@ export default function SignInPage() {
8787
</SignIn.Step>
8888
<SignIn.Step
8989
name='choose-strategy'
90-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white'
90+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 sm:w-96 sm:px-8'
9191
>
9292
<header className='text-center'>
9393
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Use another method</h1>
@@ -133,15 +133,15 @@ export default function SignInPage() {
133133
<p className='text-center text-sm'>
134134
<SignIn.Action
135135
navigate='previous'
136-
className='hover:cursor-pointer rounded px-1 py-0.5 text-neutral-700 outline-none hover:bg-neutral-100 focus-visible:bg-neutral-100'
136+
className='rounded px-1 py-0.5 text-neutral-700 outline-none hover:cursor-pointer hover:bg-neutral-100 focus-visible:bg-neutral-100'
137137
>
138138
Go back
139139
</SignIn.Action>
140140
</p>
141141
</SignIn.Step>
142142
<SignIn.Step
143143
name='forgot-password'
144-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white'
144+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 sm:w-96 sm:px-8'
145145
>
146146
<header className='text-center'>
147147
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Forgot password?</h1>
@@ -171,12 +171,12 @@ export default function SignInPage() {
171171
</SignIn.Step>
172172
<SignIn.Step
173173
name='verifications'
174-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white'
174+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 sm:w-96 sm:px-8'
175175
>
176176
<SignIn.Strategy name='password'>
177177
<header className='text-center'>
178178
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Enter your password</h1>
179-
<p className='text-sm mt-2 text-neutral-500'>
179+
<p className='mt-2 text-sm text-neutral-500'>
180180
Welcome back <SignIn.Salutation />
181181
</p>
182182
</header>
@@ -301,15 +301,15 @@ export default function SignInPage() {
301301
<div className='text-center text-sm'>
302302
<SignIn.Action
303303
navigate='choose-strategy'
304-
className='hover:cursor-pointer rounded px-1 py-0.5 text-neutral-700 outline-none hover:bg-neutral-100 focus-visible:bg-neutral-100'
304+
className='rounded px-1 py-0.5 text-neutral-700 outline-none hover:cursor-pointer hover:bg-neutral-100 focus-visible:bg-neutral-100'
305305
>
306306
Use another method
307307
</SignIn.Action>
308308
</div>
309309
</SignIn.Step>
310310
<SignIn.Step
311311
name='reset-password'
312-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white'
312+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 sm:w-96 sm:px-8'
313313
>
314314
<header className='text-center'>
315315
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Reset your password</h1>

integration/templates/elements-next/src/app/validate-password/page.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export default function ValitePassword() {
1212
<SignIn.Root path='/validate-password'>
1313
<SignIn.Step
1414
name='start'
15-
className='w-full space-y-6 rounded-2xl px-4 py-10 sm:w-96 sm:px-8 bg-white text-center shadow-md'
15+
className='w-full space-y-6 rounded-2xl bg-white px-4 py-10 text-center shadow-md sm:w-96 sm:px-8'
1616
>
1717
<header className='text-center'>
1818
<h1 className='text-xl font-medium tracking-tight text-neutral-950'>Password Validation Playground</h1>
19-
<p className='text-sm mt-2 text-neutral-500'>
19+
<p className='mt-2 text-sm text-neutral-500'>
2020
Just to test out the{' '}
2121
<a
2222
className='text-zinc-950 decoration-zinc-950/20 underline-offset-4 outline-none hover:text-zinc-700 hover:underline focus-visible:underline'
@@ -28,7 +28,7 @@ export default function ValitePassword() {
2828
</p>
2929
</header>
3030
<Clerk.Field name='password'>
31-
<div className='flex justify-between mb-2'>
31+
<div className='mb-2 flex justify-between'>
3232
<Clerk.Label className='text-sm font-medium text-zinc-950'>Password</Clerk.Label>
3333
<button
3434
onClick={() => setHidden(s => !s)}
@@ -46,36 +46,36 @@ export default function ValitePassword() {
4646
{({ state, codes, message }) => (
4747
<div className='mt-6'>
4848
<p className='mb-2'>Field State Props</p>
49-
<table className='table-auto w-full border-collapse text-sm'>
49+
<table className='w-full table-auto border-collapse text-sm'>
5050
<thead className='bg-slate-200'>
5151
<tr>
52-
<th className='border-b font-medium p-2 pl-4 text-left'>Prop</th>
53-
<th className='border-b font-medium p-2 pl-4 text-left'>Value</th>
52+
<th className='border-b p-2 pl-4 text-left font-medium'>Prop</th>
53+
<th className='border-b p-2 pl-4 text-left font-medium'>Value</th>
5454
</tr>
5555
</thead>
5656
<tbody>
5757
<tr>
58-
<td className='border-b font-medium p-2 pl-4 text-left'>State</td>
58+
<td className='border-b p-2 pl-4 text-left font-medium'>State</td>
5959
<td
60-
className='border-b font-medium p-2 pl-4 text-left'
60+
className='border-b p-2 pl-4 text-left font-medium'
6161
data-testid='state'
6262
>
6363
{state}
6464
</td>
6565
</tr>
6666
<tr>
67-
<td className='border-b font-medium p-2 pl-4 text-left'>Codes</td>
67+
<td className='border-b p-2 pl-4 text-left font-medium'>Codes</td>
6868
<td
69-
className='border-b font-medium p-2 pl-4 text-left'
69+
className='border-b p-2 pl-4 text-left font-medium'
7070
data-testid='codes'
7171
>
7272
{codes?.join(', ')}
7373
</td>
7474
</tr>
7575
<tr>
76-
<td className='border-b font-medium p-2 pl-4 text-left'>Message</td>
76+
<td className='border-b p-2 pl-4 text-left font-medium'>Message</td>
7777
<td
78-
className='border-b font-medium p-2 pl-4 text-left'
78+
className='border-b p-2 pl-4 text-left font-medium'
7979
data-testid='message'
8080
>
8181
{message}

integration/templates/next-app-router-quickstart/src/app/page.module.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
border-radius: var(--border-radius);
5252
background: rgba(var(--card-rgb), 0);
5353
border: 1px solid rgba(var(--card-border-rgb), 0);
54-
transition: background 200ms, border 200ms;
54+
transition:
55+
background 200ms,
56+
border 200ms;
5557
}
5658

5759
.card span {

integration/templates/next-app-router/src/app/page.module.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
border-radius: var(--border-radius);
5252
background: rgba(var(--card-rgb), 0);
5353
border: 1px solid rgba(var(--card-border-rgb), 0);
54-
transition: background 200ms, border 200ms;
54+
transition:
55+
background 200ms,
56+
border 200ms;
5557
}
5658

5759
.card span {

integration/templates/react-cra/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

integration/templates/react-vite/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

0 commit comments

Comments
 (0)