ui icon indicating copy to clipboard operation
ui copied to clipboard

Alert component styling broken with Lucide Icon

Open MurrayOB opened this issue 1 year ago • 6 comments

Pictures taken from the docs page: https://ui.shadcn.com/docs/components/alert

Screenshot 2023-06-21 at 19 32 15

Screenshot 2023-06-21 at 19 32 09

The alert component alongside Lucide icon like specified in the docs seem to be broken on the docs and when installing:

MurrayOB avatar Jun 21 '23 11:06 MurrayOB

Which browser are you using?

dan5py avatar Jun 21 '23 11:06 dan5py

Which browser are you using?

@dan5py Firefox

Just opened in Google and works fine, so seems to be Firefox

MurrayOB avatar Jun 21 '23 11:06 MurrayOB

Just opened in Google and works fine, so seems to be Firefox

@MurrayOB yeah, the issue appears only using Firefox since the :has pseudo-class isn't supported and the alert component makes use of that to add a left padding.

https://github.com/shadcn/ui/blob/3d717f992b26ee72db05b9020e4c951ee1dd8727/apps/www/components/ui/alert.tsx#L7-L7

There's nothing to do about it. We need to wait until Firefox adds support for this feature.

dan5py avatar Jun 21 '23 12:06 dan5py

Just opened in Google and works fine, so seems to be Firefox

@MurrayOB yeah, the issue appears only using Firefox since the :has pseudo-class isn't supported and the alert component makes use of that to add a left padding.

https://github.com/shadcn/ui/blob/3d717f992b26ee72db05b9020e4c951ee1dd8727/apps/www/components/ui/alert.tsx#LL7C143-L7C161

Thanks, I see, not sure if I should close this? Looks like it will be implemented into Firefox soon? https://connect.mozilla.org/t5/ideas/when-is-has-css-selector-going-to-be-fully-implemented-in/idc-p/27010/highlight/true#M19088

MurrayOB avatar Jun 21 '23 12:06 MurrayOB

I hope so 🤞 . (For now leave the issue opened, in case someone else needs help with this)

dan5py avatar Jun 21 '23 12:06 dan5py

Temporarily alternative variant [&>svg~*]:pl-7

adham-coding avatar Jun 28 '23 04:06 adham-coding

It's currently an experimental feature in Firefox, but you can enable it by changing layout.css.has-selector.enabled to true in about:config @MurrayOB

LukaHietala avatar Jul 07 '23 18:07 LukaHietala

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jun 23 '24 23:06 shadcn