Visually concentric radii

Put a rounded thing inside another rounded thing and the usual advice is to subtract the padding from the outer radius. Both corners then share a centre, so the gap between them stays even all the way round.

inner = outer − padding

That works while the radii are big but on small ones the visuals starts to break, and you get sharp corners inside round ones.

The math is right. It just looks wrong. The easiest fix is to keep the math and just never let the inner corner go sharp while the outer one is curved.

Naiveinner 0px
Visualinner 2px
Outer
Padding

So we keep the concentric value and just put a floor under it:

floor = max( outer / 2, min(2, outer) )

inner = max( outer − padding, floor )

  • what true concentric gives you
  • a floor, so the corner is never sharp
  • 2px minimum
  • (only when padding ≤ outer, otherwise it keeps its own radius)
e.g. outer 16, padding 12 → 4 … too sharp, so the floor bumps it to 8

Installation

Copy this into your coding agent. It points the agent at the skill, which recognises how your project writes styles and adds the rule the same way.

  1. 1

    Reads your project

    Works out how to add the utility the way your project writes styles, and finds the nested corners where it would replace a radius set by hand. Changes nothing.

  2. 2

    Asks for your OK

    Explains how it will add the utility, then lists the places it would use it in a short table for you to confirm. Then waits.

  3. 3

    Does what you confirmed

    Adds the utility and updates only the places you picked, then checks a nested corner comes out right.

Add visually concentric radii from Launch Studio Labs to my project. Skill (follow it): https://labs.launchstudio.space/skills/visual-concentric-radii/SKILL.md