Repository navigation
feat(theme): add an icon-only style and icon sizes to the button recipe - #408
Merged
Merged
Conversation
Each button size sets --button--icon--size for the icons in its leading and trailing slots. A button with data-icon-only and data-size is square, with its label hidden from view but kept as the accessible name. The selectors match the markup Inkline's Button already renders.
alexgrozav
marked this pull request as ready for review
November 20, 2026 21:19
Merged
9 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The button recipe now sizes icons and styles icon-only buttons, so Inkline's Button can drop its three local icon-only rules once it takes the next
@styleframe/themerelease. It adds four rules:--button--icon--size(0.875,1,1,1.25and1.25spacing steps fromxstoxl, as in the Open Components reference). The value is a root theme variable, and each button sets its own size's value at zero specificity with:where(), so any single class on the button overrides it.data-slot="leading"anddata-slot="trailing"children are centred boxes of that size, and the icon inside fills them.data-icon-onlyanddata-sizeis square: its inline padding takes the size's block padding, and the leading slot is a square box as tall as the line, or as the icon when a larger icon size is set.data-slot="label"child of an icon-only button is hidden from view with a 1px clipped box, so it stays the accessible name.The selectors live in the recipe's
setup, since no recipe key can reach the slot children. They use the attributes Inkline already renders (data-size,data-icon-only,data-slot), so Inkline changes no markup. The size variants now read their block padding from oneblockPaddingtable that the icon-only rules share, and the compiled CSS of a labelled button is unchanged: a diff of the compiled recipe againstmainshows only added lines.Storybook's
Button.vuegetsleadingandtrailingslots, aniconOnlyprop anddata-size, and two new stories, "With Icons" and "Icon Only", show every size. The docs page gets an "Icons" section with the markup, an "Icon Size" column, an accessibility note and a customisation note.Related issue
None in this repository.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passespnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scopeNotes / screenshots
paddingTopthrough the recipe options also needs to override the icon-onlypadding-inline, sincesetupcan't read the options. The docs say so.2removerride gives 32px icons in still-square buttons, andgetByRole("button", { name })finds each one.