Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Primary colors used in New York style tooltips #6132

Open
2 tasks done
vikasr111 opened this issue Dec 19, 2024 · 0 comments
Open
2 tasks done

[bug]: Primary colors used in New York style tooltips #6132

vikasr111 opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vikasr111
Copy link

Describe the bug

Here's the tooltip in NewYork Style:

"use client";

import * as React from "react";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";

import { cn } from "@/lib/utils";

const TooltipProvider = TooltipPrimitive.Provider;

const Tooltip = TooltipPrimitive.Root;

const TooltipTrigger = TooltipPrimitive.Trigger;

const TooltipContent = React.forwardRef<
  React.ElementRef<typeof TooltipPrimitive.Content>,
  React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
  <TooltipPrimitive.Portal>
    <TooltipPrimitive.Content
      ref={ref}
      sideOffset={sideOffset}
      className={cn(
        "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
        className
      )}
      {...props}
    />
  </TooltipPrimitive.Portal>
));
TooltipContent.displayName = TooltipPrimitive.Content.displayName;

export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };

If you notice it uses primary colors. So if I switch the theme to blue or some other colorful theme, the tooltip background also changes to blue which looks pretty odd.

Under default theme it uses popover colors which still looks decent. Am I missing something?

Affected component/components

tooltip

How to reproduce

Check the code of tooltip component

Codesandbox/StackBlitz link

https://ui.shadcn.com/docs/components/tooltip

Logs

No response

System Info

Chrome
MacOS

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@vikasr111 vikasr111 added the bug Something isn't working label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant