From ebb858daee2acf0caff89915bd3379d8918bf948 Mon Sep 17 00:00:00 2001 From: Mohamad Mohebifar Date: Sun, 10 Mar 2024 11:17:18 -0400 Subject: [PATCH] chore: Add prettier tailwindcss plugin --- .prettierrc | 4 +++- apps/docs/components/BeforeAfterCodeLayout.tsx | 14 +++++++------- apps/docs/components/DependencyGraphViewer.tsx | 2 +- .../DynamicDependencyGraphViewer.tsx | 2 +- .../components/DynamicLiveCodeSandpack.tsx | 4 ++-- apps/docs/components/Hero.tsx | 6 +++--- apps/docs/components/LiveCodeSandpack.tsx | 2 +- apps/docs/components/Logo.tsx | 4 ++-- apps/docs/components/OldAndNewCodeReveal.tsx | 2 +- apps/docs/components/ui/text-reveal-card.tsx | 18 +++++++++--------- package.json | 1 + yarn.lock | 5 +++++ 12 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.prettierrc b/.prettierrc index 0967ef4..b0e6c85 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1,3 @@ -{} +{ + "plugins": ["prettier-plugin-tailwindcss"] +} diff --git a/apps/docs/components/BeforeAfterCodeLayout.tsx b/apps/docs/components/BeforeAfterCodeLayout.tsx index 8da3d59..ecb0d92 100644 --- a/apps/docs/components/BeforeAfterCodeLayout.tsx +++ b/apps/docs/components/BeforeAfterCodeLayout.tsx @@ -11,10 +11,10 @@ export function BeforeAfterCodeLayout({ after, }: BeforeAfterCodeLayoutProps) { return ( -
+
-
-
+
+
Input Code
@@ -24,18 +24,18 @@ export function BeforeAfterCodeLayout({
-
+
-
-
+
+
React Unforget Result
diff --git a/apps/docs/components/DependencyGraphViewer.tsx b/apps/docs/components/DependencyGraphViewer.tsx index 4e178db..f7d256b 100644 --- a/apps/docs/components/DependencyGraphViewer.tsx +++ b/apps/docs/components/DependencyGraphViewer.tsx @@ -65,7 +65,7 @@ const DependencyGraphViewer = ({ Below is a visual representation of the dependency graph that React Unforget's compiler sees to ultimately optimize your code.

-
+
); }; diff --git a/apps/docs/components/DynamicDependencyGraphViewer.tsx b/apps/docs/components/DynamicDependencyGraphViewer.tsx index ba26c5a..65fd14a 100644 --- a/apps/docs/components/DynamicDependencyGraphViewer.tsx +++ b/apps/docs/components/DynamicDependencyGraphViewer.tsx @@ -4,7 +4,7 @@ const DynamicDependencyGraphViewer = dynamic( () => import("./DependencyGraphViewer"), { loading: () => ( -
+
), diff --git a/apps/docs/components/DynamicLiveCodeSandpack.tsx b/apps/docs/components/DynamicLiveCodeSandpack.tsx index 8c9e8a3..f0e5683 100644 --- a/apps/docs/components/DynamicLiveCodeSandpack.tsx +++ b/apps/docs/components/DynamicLiveCodeSandpack.tsx @@ -6,12 +6,12 @@ const DynamicLiveCodeSandpack = dynamic(() => import("./LiveCodeSandpack"), { return ( +
} after={ -
+
} diff --git a/apps/docs/components/Hero.tsx b/apps/docs/components/Hero.tsx index 6290589..90a76d7 100644 --- a/apps/docs/components/Hero.tsx +++ b/apps/docs/components/Hero.tsx @@ -1,10 +1,10 @@ import { OldAndNewCodeReveal } from "./OldAndNewCodeReveal"; export const Hero = () => ( -
-
+
+
-

+

React Unforget

diff --git a/apps/docs/components/LiveCodeSandpack.tsx b/apps/docs/components/LiveCodeSandpack.tsx index 84be1b6..fce96e0 100644 --- a/apps/docs/components/LiveCodeSandpack.tsx +++ b/apps/docs/components/LiveCodeSandpack.tsx @@ -137,7 +137,7 @@ function LiveCodeSandpack({ children, previewClassName }: LiveCodeProps) { />

diff --git a/apps/docs/components/Logo.tsx b/apps/docs/components/Logo.tsx index f86f4b2..1cf5c4f 100644 --- a/apps/docs/components/Logo.tsx +++ b/apps/docs/components/Logo.tsx @@ -3,8 +3,8 @@ export type LogoProps = { }; export const Logo = ({ className = "text-xl" }: LogoProps) => ( - React{" "} - + React{" "} + Unforget diff --git a/apps/docs/components/OldAndNewCodeReveal.tsx b/apps/docs/components/OldAndNewCodeReveal.tsx index b11f0a2..409cc67 100644 --- a/apps/docs/components/OldAndNewCodeReveal.tsx +++ b/apps/docs/components/OldAndNewCodeReveal.tsx @@ -64,7 +64,7 @@ const newCode = `const NiceComponent = () => export const OldAndNewCodeReveal = () => { return ( -
+
You don't need all that clutter! diff --git a/apps/docs/components/ui/text-reveal-card.tsx b/apps/docs/components/ui/text-reveal-card.tsx index 1a48e54..2091ff5 100644 --- a/apps/docs/components/ui/text-reveal-card.tsx +++ b/apps/docs/components/ui/text-reveal-card.tsx @@ -57,13 +57,13 @@ export const TextRevealCard = ({ onMouseMove={mouseMoveHandler} ref={cardRef} className={cn( - "bg-[#1d1c20] border border-white/[0.08] w-[24rem] sm:w-[30rem] rounded-lg p-8 pb-2 relative overflow-hidden", + "relative w-[20rem] overflow-hidden rounded-lg border border-white/[0.08] bg-[#1d1c20] p-8 pb-2 sm:w-[30rem]", className, )} > {children} -
+
         
@@ -96,12 +96,12 @@ export const TextRevealCard = ({
             opacity: widthPercentage > 0 ? 1 : 0,
           }}
           transition={isMouseOver ? { duration: 0 } : { duration: 0.4 }}
-          className="h-40 w-[8px] bg-gradient-to-b from-transparent via-neutral-800 to-transparent absolute z-20 will-change-transform"
+          className="absolute z-20 h-40 w-[8px] bg-gradient-to-b from-transparent via-neutral-800 to-transparent will-change-transform"
         >
 
-        
+
           
@@ -119,7 +119,7 @@ export const TextRevealCardTitle = ({
   className?: string;
 }) => {
   return (
-    

+

{children}

); @@ -133,7 +133,7 @@ export const TextRevealCardDescription = ({ className?: string; }) => { return ( -

{children}

+

{children}

); }; diff --git a/package.json b/package.json index 2b1efe7..6a54a86 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@react-unforget/eslint-config": "*", "@react-unforget/typescript-config": "*", "prettier": "^3.1.1", + "prettier-plugin-tailwindcss": "^0.5.12", "turbo": "latest" }, "engines": { diff --git a/yarn.lock b/yarn.lock index c4000a4..74745aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8382,6 +8382,11 @@ prettier-plugin-packagejson@^2.4.5: sort-package-json "2.8.0" synckit "0.9.0" +prettier-plugin-tailwindcss@^0.5.12: + version "0.5.12" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.12.tgz#655999849344548ecf4d9b47a051ed856f041c72" + integrity sha512-o74kiDBVE73oHW+pdkFSluHBL3cYEvru5YgEqNkBMFF7Cjv+w1vI565lTlfoJT4VLWDe0FMtZ7FkE/7a4pMXSQ== + prettier@^2.7.1: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"