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

Alert has left padding even when the icon is not a direct child #1177

Open
matteocontrini opened this issue Jul 7, 2024 · 0 comments · May be fixed by #1254
Open

Alert has left padding even when the icon is not a direct child #1177

matteocontrini opened this issue Jul 7, 2024 · 0 comments · May be fixed by #1254
Labels
status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation type: enhancement An improvement or enhancement to an existing feature

Comments

@matteocontrini
Copy link

Describe the bug

The Alert component has a left padding to make space for an SVG icon if present. This padding is however added if there's an SVG icon anywhere in the children of the Alert, and not only if it's a direct child, as it should be (the original shadcdn/ui behaves like this).

Reproduction

https://stackblitz.com/edit/github-jf1qen?file=src%2Froutes%2F%2Bpage.svelte

In the second case here there should be no padding.

CleanShot 2024-07-07 at 22 23 27@2x

The fix would be:

- [&:has(svg)]:pl-11
+ [&:has(>svg)]:pl-11

CleanShot 2024-07-07 at 22 25 54@2x

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/kit: ^2.0.0 => 2.5.2 
    bits-ui: ^0.18.2 => 0.18.2 
    cmdk-sv: ^0.0.13 => 0.0.13 
    formsnap: ^0.5.0 => 0.5.0 
    lucide-svelte: ^0.303.0 => 0.303.0 
    mode-watcher: ^0.2.1 => 0.2.1 
    svelte: ^4.2.9 => 4.2.9 
    svelte-sonner: ^0.3.18 => 0.3.18 
    sveltekit-superforms: ^2.5.0 => 2.5.0 
    vaul-svelte: ^0.2.4 => 0.2.4

Severity

annoyance

@huntabyte huntabyte added status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation type: enhancement An improvement or enhancement to an existing feature labels Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation type: enhancement An improvement or enhancement to an existing feature
Projects
None yet
2 participants