shyakadavis / geist

Svelte implementation of the Geist Design System by Vercel. (WIP)
https://geist.shyakadavis.me/
62 stars 6 forks source link

fix: Tabs overflow handling #50

Closed ieedan closed 1 month ago

ieedan commented 1 month ago

Currently the tabs component uses flex-wrap so the tabs stack on overflow.

github-actions[bot] commented 1 month ago
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
geist ✅ Ready (View Log) Visit Preview ca67518a605f07d55777471a6ad3d71e7014aea1
ieedan commented 1 month ago

Thanks I should have some updates in an hour or two once I get back from lunch

ieedan commented 1 month ago

I tried a few of the solutions you sent I couldn't find anything much better than what I already have. I darkened up the shadow though so now it is more visible.

To make it work I have to wrap it in a <div class="relative"> which isn't very nice.

Let me know what you think!

shyakadavis commented 1 month ago

Hey, @ieedan

You're right. No easy solution would have worked without adding an unnecessary div, so instead of foregoing on the indicate overflow bit, let's use a mask instead. I know adding a package for just a mask is overkill, but I suspect this will come in handy in other places/future, and for what it's worth, the plugin is only a few lines-ish.

https://github.com/pyncz/tailwind-mask-image

Before with blur:

Screenshot 2024-08-14 at 14 28 48

After with mask:

Screenshot 2024-08-14 at 15 12 08

ieedan commented 1 month ago

Yeah that looks much better

ieedan commented 1 month ago

image

I think we need 2 masks for situations like this

shyakadavis commented 1 month ago

Ah, I see. Sorry for missing this.

Mind opening a follow-up P.R please? I was working on the Table component, and might get to it late.

ieedan commented 1 month ago

Yeah np.

I think this is too much?

image

shyakadavis commented 1 month ago

Might be indeed. 😅 Even if we were to reduce the mask-point-to-[{percetage}] it could still be too much. 🤷

ieedan commented 1 month ago

I am gonna play with it a bit more hopefully I can get it to match up with what we have already

ieedan commented 1 month ago

This looks much closer Both: image

Post: image

ieedan commented 1 month ago

My best idea at this point is to use a Pseudo-element to do this.

In a perfect world I could just overlay a ::before element with its own mask on top but this has not been very easy.

I am having a lot of trouble doing this right now and even if I can get the classes to apply we would still need to apply it to a parent container of the tabs because it moves during scroll.

I think I'll have to circle back at another time.