Rim

Fast and intuitive radius calculations

Learn more about the math

Understanding the Math: Right vs Wrong

outer r = inner r

Visual inconsistency - inner corners appear sharper

outer r = inner r + padding

Visual harmony - consistent corner curvature

Wrong Approach

Using the same radius for both outer container and inner content creates visual inconsistency. The inner content appears to have sharper corners than intended.

outer_radius = inner_radius = 20px

Correct Approach

Start with your desired inner content radius, then add padding. The outer radius adjusts automatically to maintain visual consistency.

outer_radius = inner_radius + padding

The Formula

outer_radius = inner_radius + padding

Why It Matters

Proper radius calculations ensure visual harmony between nested elements. Without this adjustment, designs look inconsistent and unprofessional.

Common Use Cases

  • • Card layouts
  • • Button corners
  • • Form input styling
  • • Modal dialogs
  • • Navigation bars