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.
12345{ "rules": { "systomic/concentric-radius": "warn" }}See the difference
rounded-3xl p-2 › className="rounded-3xl"rounded-3xl p-2 › className="rounded-2xl"What doesn't work
Oxlint
3 findings1234567891011121314151617181920212223242526272829import { Menu } from "@base-ui/react/menu";
export function ProjectCard() { return ( <div className="rounded-xl p-1"> <img className="rounded-md" src="/cover.png" alt="" /> </div> );}
export function ProjectMenu({ items }: { items: string[] }) { return ( <Menu.Popup className="rounded-lg p-1"> {items.map((item) => ( <Menu.Item key={item} className="rounded-md px-2 py-1.5"> {item} </Menu.Item> ))} </Menu.Popup> );}
export function Panel() { return ( <div style={{ borderRadius: 50, padding: 20 }}> <div style={{ borderRadius: 24 }} /> </div> );}systomic/concentric-radius 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.
systomic/concentric-radius rounded-md is 6px, but its parent's corners are 8px with 4px of padding: a concentric inner radius is 8px − 4px = 4px. Use rounded-sm.
systomic/concentric-radius borderRadius: 24 is 24px, but its parent's corners are 50px with 20px of padding: a concentric inner radius is 50px − 20px = 30px. Use borderRadius: 30.
Stylelint
1 finding12345678.card { border-radius: 12px; padding: 4px;}
.card > .media { border-radius: 6px;}systomic/concentric-radius border-radius: 6px is 6px, but its parent's corners are 12px with 4px of padding: a concentric inner radius is 12px − 4px = 8px. Use border-radius: 8px.
What works
No findingsOxlint
123456789101112131415161718192021222324252627282930313233343536373839import { Menu } from "@base-ui/react/menu";
export function ProjectCard() { return ( <div className="rounded-xl p-1"> <img className="rounded-lg" src="/cover.png" alt="" /> </div> );}
export function ProjectMenu({ items }: { items: string[] }) { return ( <Menu.Popup className="rounded-lg p-1"> {items.map((item) => ( <Menu.Item key={item} className="rounded-sm px-2 py-1.5"> {item} </Menu.Item> ))} </Menu.Popup> );}
/** 50 − 20 = 30. */export function Panel() { return ( <div style={{ borderRadius: 50, padding: 20 }}> <div style={{ borderRadius: 30 }} /> </div> );}
/** Padding larger than the radius: the corners aren't nested visually. */export function Article() { return ( <article className="rounded-lg p-6"> <img className="rounded-md" src="/hero.png" alt="" /> </article> );}Stylelint
12345678.card { border-radius: 12px; padding: 4px;}
.card > .media { border-radius: 8px;}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.
1inner radius = outer radius − padding − border1234<div className="rounded-xl p-1"> <div className="rounded-md" /> // reported: 12px − 4px = 8px <div className="rounded-lg" /> // fine</div>
rounded-mdis 6px, but its parent’s corners are 12px with 4px of padding: a concentric inner radius is 12px − 4px = 8px. Userounded-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-*, orpx-*andpy-*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 baserounded-*class andborderRadius*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-hiddencard clips its image), or different padding per side. rounded-noneandrounded-fullchildren, 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.
12.card { border-radius: 12px; padding: 4px; }.card > .media { border-radius: 6px; } /* reported: use 8px */