agentleFS
dylantarredylantarre/design-system-skills/skills/tokens/radius-scale/SKILL.md

radius-scale

Skill50 starsChanged 11 months agoMITView on GitHub

Generates border-radius tokens from sharp to pill shapes. Use when creating corner rounding systems, button radius, card corners, or input styling. Outputs CSS, Tailwind, or JSON.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Get base radius: Default 8px (balanced starting point)

    line 33
  2. Distinctive:

    Include full?: Add "full" (9999px) for pills?

    line 38
  3. Distinctive:

    Generate: Create scale centered on base

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Radius Scale Generator

Overview

Generate consistent border-radius scales from sharp to pill-shaped. Creates harmonious rounding that scales appropriately with element size for visual consistency.

When to Use

  • Setting up radius tokens for a new project
  • Standardizing corner rounding across components
  • Creating button/card/input styling consistency
  • Building component-size-aware radius systems

Quick Reference

LevelTypical ValueUse Case
none0Sharp corners, tables
sm2-4pxSubtle rounding, inputs
md6-8pxButtons, cards
lg12-16pxModals, large cards
xl20-24pxPanels, containers
2xl32px+Feature sections
full9999pxPills, avatars, badges

The Process

  1. Get base radius: Default 8px (balanced starting point)
  2. Get ratio: How much each step grows (1.5-2 typical)
  3. Ask steps: How many radius values (5-7 typical)
  4. Ask unit: px or rem?
  5. Ask format: CSS, Tailwind, or JSON?
  6. Include full?: Add "full" (9999px) for pills? (default: yes)
  7. Generate: Create scale centered on base

Common Scales

CharacterBaseRatioResult
Subtle4px1.52, 3, 4, 6, 9, 13
Balanced8px22, 4, 8, 16, 32
Rounded12px1.55, 8, 12, 18, 27, 40
Soft16px1.57, 11, 16, 24, 36, 54

Output Formats

CSS Custom Properties:

:root {
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
}

Tailwind Config:

module.exports = {
  theme: {
    borderRadius: {
      'none': '0',
      'sm': '4px',
      'md': '8px',
      'lg': '16px',
      'xl': '24px',
      '2xl': '32px',
      'full': '9999px',
    }
  }
}

JSON Tokens:

{
  "radius": {
    "none": { "value": "0" },
    "sm": { "value": "4px" },
    "md": { "value": "8px" },
    "lg": { "value": "16px" },
    "xl": { "value": "24px" },
    "2xl": { "value": "32px" },
    "full": { "value": "9999px" }
  }
}

Contextual Radius

Larger elements often need proportionally larger radius. Consider semantic tokens:

CSS with contextual tokens:

:root {
  /* Base scale */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Semantic/contextual */
  --radius-button: var(--radius-md);
  --radius-input: var(--radius-sm);
  --radius-card: var(--radius-lg);
  --radius-modal: var(--radius-xl);
  --radius-badge: var(--radius-full);
  --radius-avatar: var(--radius-full);
}

Algorithm

The scale uses exponential growth from a base:

value = baseValue * (ratio ^ (step - midpoint))

For a 7-step scale with base 8px and ratio 2:

  • Step 0 (3 below): 8 * 2^-3 = 1px
  • Step 3 (mid): 8 * 2^0 = 8px
  • Step 6 (3 above): 8 * 2^3 = 64px

Values are typically rounded to clean numbers.

Design Considerations

Consistency rule: Inner radius = outer radius - border/padding

/* Card with nested element */
.card {
  border-radius: var(--radius-lg); /* 16px */
  padding: 8px;
}
.card-inner {
  border-radius: calc(var(--radius-lg) - 8px); /* 8px */
}

Squircle alternative: For iOS-style continuous curves, consider mask-image with SVG or libraries like squircle.js.

Common Patterns

ComponentRecommended Radius
Icon buttonssm or md
Text buttonsmd
Input fieldssm or md
Cardslg
Modals/dialogslg or xl
Tooltipsmd
Badges/tagsfull (pill)
Avatarsfull (circle)
Containersxl or 2xl

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.