Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: text visible in dark mode in Letter PullUp component (#63)

santisemhand4078baf7df0
diff --git a/registry/components/example/letter-pullup-demo.tsx b/registry/components/example/letter-pullup-demo.tsx
index 04e36475..93b6909d 100644
--- a/registry/components/example/letter-pullup-demo.tsx
+++ b/registry/components/example/letter-pullup-demo.tsx
@@ -1,11 +1,11 @@
import LetterPullup from "@/registry/components/magicui/letter-pullup";
- export default async function LetterPullupDemo() {
- return (
- <LetterPullup
- className = "text-black"
- words = { "Staggered Letter Pull Up" }
- delay = { 0.05 }
- />
- );
- }
\ No newline at end of file
+export default async function LetterPullupDemo() {
+ return (
+ <LetterPullup
+ className="text-black dark:text-white"
+ words={"Staggered Letter Pull Up"}
+ delay={0.05}
+ />
+ );
+}
diff --git a/registry/components/magicui/letter-pullup.tsx b/registry/components/magicui/letter-pullup.tsx
index f6abcca4..246bef45 100644
--- a/registry/components/magicui/letter-pullup.tsx
+++ b/registry/components/magicui/letter-pullup.tsx
@@ -4,49 +4,46 @@ import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
interface LetterPullupProps {
- className?: string;
- words: string;
- delay?: number
+ className?: string;
+ words: string;
+ delay?: number;
}
export default function LetterPullup({
- className,
- words,
- delay
-
+ className,
+ words,
+ delay,
}: LetterPullupProps) {
-
- const letters = words.split("");
-
- const pullupVariant = {
- initial: { y: 100, opacity: 0 },
- animate: (i: any) => ({
- y: 0,
- opacity: 1,
- transition: {
- delay: i * (delay ? delay : 0.05), // By default, delay each letter's animation by 0.05 seconds
- },
- }),
- };
+ const letters = words.split("");
+
+ const pullupVariant = {
+ initial: { y: 100, opacity: 0 },
+ animate: (i: any) => ({
+ y: 0,
+ opacity: 1,
+ transition: {
+ delay: i * (delay ? delay : 0.05), // By default, delay each letter's animation by 0.05 seconds
+ },
+ }),
+ };
return (
- <div className = "flex justify-center">
-
- { letters.map((letter, i) => (
-
+ <div className="flex justify-center">
+ {letters.map((letter, i) => (
<motion.h1
- key = { i }
- variants = { pullupVariant }
- initial = "initial"
- animate = "animate"
- custom = { i }
- className = { cn("text-center font-display text-4xl font-bold tracking-[-0.02em] drop-shadow-sm md:text-4xl md:leading-[5rem]", className) }
+ key={i}
+ variants={pullupVariant}
+ initial="initial"
+ animate="animate"
+ custom={i}
+ className={cn(
+ "font-display text-center text-4xl font-bold tracking-[-0.02em] drop-shadow-sm md:text-4xl md:leading-[5rem]",
+ className,
+ )}
>
{letter === " " ? <span>&nbsp;</span> : letter}
</motion.h1>
-
))}
-
</div>
);
}