About this set
A five-step button size scale, extra small, small, default, large and extra large, plus square icon-only buttons in four matching sizes and a block button that fills up to 340 pixels. Use extra small and small in dense tables and toolbars, default for forms, large for page-level actions and extra large for a hero. In the plain CSS version one rule draws every button from three custom properties, –pad, –fs and –r, and each size class overrides only those three, so a change to the base colour, weight or focus style reaches every size at once. The icon-only buttons reuse the same classes and add a side length through –sq, and the plus icon scales to 45 percent of the button. In the Bootstrap version the base is .btn with the –bs-btn-padding, –bs-btn-font-size and –bs-btn-border-radius variables set, Bootstrap’s own .btn-sm and .btn-lg are restyled to match, and .sz-xs and .sz-xl add the two extra steps. The Tailwind version swaps only the padding, text size and radius utilities between sizes.
What’s included
- Five text sizes from 12 to 17 pixel labels
- Four square icon-only sizes from 30 to 52 pixels
- Block button that shrinks to fit narrow screens
- Sizes change three values and nothing else
- Bootstrap .btn-sm and .btn-lg restyled to the same scale
Accessibility
Every button is a native button element with visible text, and each icon-only button has aria-label="Add" with its SVG hidden from assistive technology. All sizes share a 2px indigo focus outline offset by 3px (a matching ring in Bootstrap). White text on #4f46e5 is 6.3:1. The background colour transition is removed under prefers-reduced-motion.
Customise it
Edit --pad, --fs and --r on .sz and on each .sz-xs to .sz-xl class, and --sq for the icon sizes. In Bootstrap edit the --bs-btn-padding-x, --bs-btn-padding-y, --bs-btn-font-size and --bs-btn-border-radius values on .sz and its size classes; in Tailwind change the px-, py-, text- and rounded- utilities.

















