-
-
Notifications
You must be signed in to change notification settings - Fork 505
chore: tailwind v4 styles #1791
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
Conversation
|
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
|
Is this good for review @shyakadavis ? |
|
Hey, @huntabyte . I would say "yes", but would appreciate some guidance and/or eyes on these remaining issues:
|
I think we had agreed these weren't necessary since they technically aren't part of the DOM. As for the other 2 I am taking a look right now... |
CleanShot.2025-03-31.at.09.09.32.mp4This may need some tuning but I was able to do this: <script lang="ts">
import { Tooltip as TooltipPrimitive } from "bits-ui";
import { cn } from "$lib/utils.js";
let {
ref = $bindable(null),
class: className,
sideOffset = 0,
side,
children,
...restProps
}: TooltipPrimitive.ContentProps = $props();
</script>
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
bind:ref
data-slot="tooltip-content"
{sideOffset}
{side}
class={cn(
"bg-primary 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 origin-(--bits-tooltip-content-transform-origin) z-50 w-fit text-balance rounded-md px-3 py-1.5 text-xs",
className
)}
{...restProps}
>
{@render children?.()}
<TooltipPrimitive.Arrow>
{#snippet child({ props })}
<div
{...props}
class={cn(
"bg-primary top z-50 size-2.5 rotate-45 rounded-[2px]",
side === "top" && "translate-x-1/2 translate-y-[calc(-50%_+_2px)]",
side === "bottom" && "-translate-x-1/2 -translate-y-[calc(-50%_+_1px)]",
side === "right" && "translate-x-[calc(50%_+_2px)] translate-y-1/2",
side === "left" && "-translate-y-[calc(50%_-_3px)]"
)}
></div>
{/snippet}
</TooltipPrimitive.Arrow>
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>The default svg icon rendered by bits was giving me some trouble but rendering a div seems to work fine. |
|
The resizable thing is because you (I assume) copied the shadcn styles but forgot to correct |
|
Hey, let me see if I can address the remaining items now. Thanks, @ieedan |
|
that's weird it wasn't doing that for me |
I noticed that it only occurs when it's alone. When other tooltips are beside it, it's fine. 🤷 |
|
🤦♂️ Yeah what the heck man. It should be absolute so idk why that makes a difference... |
CleanShot.2025-03-31.at.15.57.53.mp4Doesn't seem to be taking the styles... |
|
I am so dumb but I found it. The let {
ref = $bindable(null),
class: className,
sideOffset = 0,
+ side = "top",
children,
...restProps
}: TooltipPrimitive.ContentProps = $props(); |
|
As for the tabs, I can push changes, but my question is, what look are we aiming for? The one on ui.shadcn.com, or the one v4.shadcn.com? |
|
I think we just need to override the styles for the original. It should still look like v4 normally but for the component preview and stuff it should look like before. |
|
I think it's fine for now tbh @ieedan - we can worry about that before the final merge depending on what shad does with his docs! |
|
In that case LGTM! |
huntabyte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're awesome!



Pagination.{Link, NextButton, PrevButton} have these errors
Fallbackinchildren={children || Fallback}fixes, makes you wonder how/whyFallbackis causing this.Will add these in a separate P.R
PopoverRange CalendarSidebarSonner