Radius

Corner radius tokens used to create the PyColors UI visual style.

PyColors UI defines a small set of radius tokens to keep corners consistent across components and layouts.

All radiuses are derived from a single base variable, ensuring global consistency and easy theming.


Base radius

:root {
  --radius: 0.625rem;
}

From this base, derived tokens are generated:

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

These tokens are mapped to Tailwind’s rounded-* utilities:

borderRadius: {
  sm: "var(--radius-sm)",
  DEFAULT: "var(--radius-md)",
  md: "var(--radius-md)",
  lg: "var(--radius-lg)",
  xl: "var(--radius-xl)",
},

This ensures all components using Tailwind’s radius utilities remain aligned with the PyColors design system.


Radius tokens

Defined once in app/global.css and consumed everywhere through Tailwind utilities.

TokenMaps to
--radius-smCompact elements, inputs, pills
--radius-mdDefault UI radius (buttons, chips)
--radius-lgCards, panels, content containers
--radius-xlModals, overlays, featured surfaces

When you use rounded-sm, rounded-md, rounded-lg, or rounded-xl, Tailwind resolves the correct token automatically.


Visual examples

rounded-sm

Small radius (--radius-sm)

rounded-md

Default radius (--radius-md)

rounded-lg

Large radius (--radius-lg)

rounded-xl

Extra-large radius (--radius-xl)
export function RadiusExample() {
  return (
    <div className="grid gap-4 sm:grid-cols-2">
      <div className="rounded-sm border bg-card px-4 py-3 text-sm">
        <div className="text-xs font-medium text-muted-foreground mb-1">
          rounded-sm
        </div>
        <div>Small radius (--radius-sm)</div>
      </div>

      <div className="rounded-md border bg-card px-4 py-3 text-sm">
        <div className="text-xs font-medium text-muted-foreground mb-1">
          rounded-md
        </div>
        <div>Default radius (--radius-md)</div>
      </div>

      <div className="rounded-lg border bg-card px-4 py-3 text-sm">
        <div className="text-xs font-medium text-muted-foreground mb-1">
          rounded-lg
        </div>
        <div>Large radius (--radius-lg)</div>
      </div>

      <div className="rounded-xl border bg-card px-4 py-3 text-sm">
        <div className="text-xs font-medium text-muted-foreground mb-1">
          rounded-xl
        </div>
        <div>Extra large radius (--radius-xl)</div>
      </div>
    </div>
  );
}

Usage guidelines

  • Use rounded-md as the default radius for most interactive elements (buttons, inputs, small cards).
  • Use rounded-lg for primary surfaces such as cards, panels, and important containers.
  • Use rounded-xl sparingly for standout elements like modals, hero sections, or featured cards.
  • Use rounded-sm for dense UIs or subtle decorative elements.

By limiting radiuses to a small, semantic set derived from a single base token, PyColors UI maintains strong visual consistency while remaining easy to adapt globally.

Need elevation guidance? See the Shadows tokens page for the matching depth scale.