Repository navigation
.btn gap is fixed at 0.375rem: no variable, and it does not scale with btn-xs … btn-xl
#4792
LDB-1
started this conversation in
Ideas / feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Versions
Observed
The size modifiers scale a button's height, font size and side padding (
--btn-p:.5rematbtn-xsup to1.5rematbtn-xl). The gap between an icon and the labelis a fixed
gap: .375remon.btn, with no variable. An extra-small button with anicon therefore has proportionally the widest gap of any size.
Reproduction
Inspect each button's computed
gap:6pxat every size, whilepadding-inlinefollows
--btn-p.Expected
The gap scales with the size like the padding does, or can be set through a variable
the way padding can.
Proposed
A
--btn-gapvariable, used by.btnand set by each size modifier next to--btn-p:The fallback keeps today's rendering for anyone not using the size modifiers.
Alternatives considered
utilitiescascade-layer workaround below, but leaves the default unbalanced at
btn-xs.--sizewithcalc(). No new variable, but couples the gap to theheight formula and is harder to override.
gap-*utilities. Works per button, but every small button in an appthen repeats the same utility.
Acceptance criteria
.btn-xs….btn-xleach set--btn-gap, and.btnuses it with a.375remfallback..btn(no size modifier) still renders a6pxgap.--btn-gapon a button or a parent overrides it without!importantandwithout a cascade-layer trick.
Workaround today
An unlayered rule placed directly in Tailwind's
utilitieslayer (where it outranksdaisyUI's nested layers without
!important):All reactions