systomic

Concentric radius

A rounded element inside a padded, rounded parent looks right when both corners share a center: the inner radius is the outer radius minus the padding.

  • RuleIn recommended.json: breaking it breaks the design-system contract.
  • WarningShows in the editor and in CI output, but doesn't fail the run (unless you pass --deny-warnings).
  • StylelintThe same check runs on .css and .scss files through the Stylelint plugin.
  • Suggested fixSuggests a replacement your editor can apply. It changes how the UI looks or moves, so oxlint --fix leaves it to you.

See the difference

Before
rounded-3xl p-2 › className="rounded-3xl"
After
rounded-3xl p-2 › className="rounded-2xl"

What doesn't work

Oxlint

3 findings

Stylelint

1 finding

What works

No findings

Oxlint

Stylelint

Details

A rounded element inside a rounded, padded parent looks right when both corners share the same center: the inner radius is the outer radius minus the space between them.

rounded-md is 6px, but its parent’s corners are 12px with 4px of padding: a concentric inner radius is 12px − 4px = 8px. Use rounded-lg.

The suggestion replaces the class (corner classes keep their corner: rounded-t-md → rounded-t-sm) or the style value.

What is compared

  • Parent: a radius on all corners (rounded-*, rounded-[50px], borderRadius), the same padding on every side (p-*, or px-* and py-* with equal values, padding) and an optional border (border, border-2, borderWidth).
  • Children: the direct children, including ones rendered from {cond && …}, ternaries and {items.map(…)} (menu items in a popup). Every base rounded-* class and borderRadius* style on them is checked.
  • Tailwind classes, inline styles and StyleX, mixed freely. StyleX conditional values use their default.

When the exact value isn’t on the radius scale, the nearest step within 2px also passes, and the suggestion picks it (the smaller one on a tie: a slightly tighter inner corner still reads as concentric, a looser one bulges). Further off, the suggestion is an arbitrary value (rounded-[40px]).

Not reported

  • Padding at least as large as the radius: the corners aren’t visually nested anymore.
  • No padding (an overflow-hidden card clips its image), or different padding per side.
  • rounded-none and rounded-full children, values from tokens (rounded-(--radius-item)), and variants (md:rounded-lg).
  • Grandchildren: only elements directly inside the padding are compared.

CSS (Stylelint)

Child rules are compared with their parent rule in the same stylesheet: .card > .media and nested & > .media, with border-radius, padding, border and @apply.

Option Default
spacing 4: px per spacing step (p-1)
radii Tailwind’s scale; merged, e.g. { "card": 20 } for rounded-card
ignore []: file globs relative to the nearest package.json (Oxlint only); see monorepos
attributes, callees, styleAttributes see styling
Esc