-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Closed
Description
What version of Tailwind CSS are you using?
v4.01.10
What build tool (or framework if it abstracts the build tool) are you using?
Vite 6.3.5
What version of Node.js are you using?
For example: v22.16.0
What browser are you using?
Chrome
What operating system are you using?
Windows
Code
export interface UserAvatarProps {
src: string | null | undefined;
firstName: string;
lastName: string | null | undefined;
className?: string;
showOnOff?: boolean;
isOnline?: boolean;
size?: number;
contentSize?: string;
borderSize?: number;
background?: string;
content?: string;
}
const UserAvatar = (props: UserAvatarProps) => {
const {
src,
firstName,
lastName,
size = 10,
contentSize = "sm",
background = "bg-accent",
content = "text-accent-content",
borderSize,
className,
showOnOff,
isOnline,
} = props;
return (
<div
className={`avatar avatar-placeholder ${
showOnOff ? (isOnline ? "avatar-online" : "avatar-offline") : ""
} ${className ? className : ""}`}
>
<div
className={`overflow-hidden rounded-full size-${size} ${
borderSize ? `border-${borderSize}` : ""
} ${background} ${content}`}
>
{src ? (
<img src={src} alt={`Avatar ${firstName} ${lastName}`} />
) : (
<span className={`text-${contentSize}`}>
{firstName[0]}
{lastName && lastName[0]}
</span>
)}
</div>
</div>
);
};
export default UserAvatar;
Describe your issue
Not assigning the size-32 and border-2 class if the size value change to 32 and border value to 2 and also not showing class even when inspect.
Metadata
Metadata
Assignees
Labels
No labels