{title}
+{description}
+Export
+ +{exportLabel}
+{exportCode}
+ - SVG Clip-Paths for
- -- Please use a desktop/laptop to view the Editor. -
- )} - -No Edited Shapes Found
- )} -- Custom Shapes -
- -- Click and drag to pan the zoomed view -
- )} -- Use mouse wheel + Ctrl to zoom in/out, or press + and - keys -
-+ Please use a desktop/laptop to view the Editor. +
+ )} + ++ No Edited Shapes Found +
+ )} ++ No Custom/Saved Shapes Found +
+ )} ++ Click and drag to pan the zoomed view +
+ )} ++ Use mouse wheel + Ctrl to zoom in/out, or press + and - keys +
+- Please use a desktop/laptop to view the Editor. -
- )} -+ Please use a desktop/laptop to view the Editor. +
+ )} ++ Using the same layer controls as box shadow. For + text-shadow, spread/inset are ignored in output. +
+ )} +Shadow Controls
+ Text shadow presets are currently available under the Presets tab. +
+ )} ++ No saved shadows yet. +
+ )} + {mode === "edited" && favouriteShadows.length === 0 && ( ++ No edited/favorited shadows yet. +
+ )} ); } diff --git a/components/view/shadow/shadow-preview.tsx b/components/view/shadow/shadow-preview.tsx index 6454356..7bde201 100644 --- a/components/view/shadow/shadow-preview.tsx +++ b/components/view/shadow/shadow-preview.tsx @@ -25,12 +25,14 @@ import { import { cn } from "@/lib/utils"; import type { ShadowPreset } from "@/types/shadow"; import { Check, Copy, Save } from "lucide-react"; -import { useState } from "react"; +import { useId, useState } from "react"; import toast from "react-hot-toast"; interface ShadowPreviewProps { + shadowMode: "box" | "text"; cssValue: string; tailwindClass: string; + textShadowValue: string; isRemoveShadow: boolean; setIsRemoveShadow: React.Dispatch+ Text Shadow +
+Tailwind Class
+ +Tailwind CSS v4 Class
- {tailwindClass}
+ {twValue}
CSS Value
- box-shadow: {cssValue}
+ {cssProperty}: {cssOutputValue}
How to use in your project
@@ -239,108 +340,51 @@ export default function ShadowPreview({
- Using Tailwind Classes
+
+ Using Tailwind CSS v4 Arbitrary Value
+
-
+
- {`Your content here`}
+ {`Your content here`}
- Using Custom CSS
+ Using Inline Style
-
+
- {`Your content here`}
+ {shadowMode === "text"
+ ? `Text Shadow
`
+ : `Your content here`}
-
- Extending Tailwind Config (v3)
-
-
-
-
- {`// tailwind.config.js
-module.exports = {
- theme: {
- extend: {
- boxShadow: {
- '${activeShadow?.shadowName || activeShadow?.name || "custom"}': '${cssValue}',
- }
- }
- }
-}`}
-
-
- Extending global.css (v4)
+ Tailwind CSS v4 @theme Token
- {`// global.css
-@theme {
- --shadow-${activeShadow?.shadowName || activeShadow?.name || "custom"}: ${cssValue};
- }
- `}
+ {`// global.css\n@theme {\n --shadow-${activeShadow?.shadowName || activeShadow?.name || "custom"}: ${cssOutputValue};\n}`}
- Then use it with:{" "}
+ Then use it with{" "}
- shadow-custom
+ {shadowMode === "text"
+ ? "[text-shadow:var(--shadow-custom)]"
+ : "shadow-custom"}
-
-
Using Tailwind Classes
++ Using Tailwind CSS v4 Arbitrary Value +
- {`Your content here`}
+ {`Your content here`}
Using Custom CSS
+Using Inline Style
- {`Your content here`}
+ {shadowMode === "text"
+ ? `Text Shadow
`
+ : `Your content here`}
- Extending Tailwind Config (v3) -
-
- {`// tailwind.config.js
-module.exports = {
- theme: {
- extend: {
- boxShadow: {
- '${activeShadow?.shadowName || activeShadow?.name || "custom"}': '${cssValue}',
- }
- }
- }
-}`}
-
- - Extending global.css (v4) + Tailwind CSS v4 @theme Token
- {`// global.css
-@theme {
- --shadow-${activeShadow?.shadowName || activeShadow?.name || "custom"}: ${cssValue};
- }
- `}
+ {`// global.css\n@theme {\n --shadow-${activeShadow?.shadowName || activeShadow?.name || "custom"}: ${cssOutputValue};\n}`}
- Then use it with:{" "}
+ Then use it with{" "}
- shadow-custom
+ {shadowMode === "text"
+ ? "[text-shadow:var(--shadow-custom)]"
+ : "shadow-custom"}
- {example.name} -
-+ {example.name} +
+
- SVG Path Animation For
Developers & Designers
-
-
- - {example.name} -
-Draw or select a path to preview
-Draw or select a path to preview
+