Skip to content

bug: Empty badges lose their 1:1 ratio when theme --size-selector is modified #4293

Description

@simoami

Reproduction URL (Required)

https://play.tailwindcss.com/GjYkrVib7m

What version of daisyUI are you using?

5.5.5

Which browsers are you seeing the problem on?

Chrome

Describe your issue

Image

After modifying the default --size-selector at the theme level, which the theme editor allows, empty badges lose their square ratio. The issue is that the padding-inline attribute uses a hardcoded value 0.25rem matching the default selector value, which makes the issue not obvious since all official themes use this value in their --size-selector. The suggested fix is to use the --size-selector variable instead of the hardcoded 0.25rem to adjust the horizontal padding.

I suggest replacing the following expression in all sizes:

padding-inline: calc(0.25rem * 3 - var(--border));

with:

padding-inline: calc(var(--size-selector) * 3 - var(--border));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions