Small radius
Useful for dense tools, inputs and work-focused UI.
Border radius changes the shape of corners. It affects tone, hierarchy and how components feel, from sharp and technical to soft and friendly.
:root {
--radius-card: 24px;
--radius-pill: 999px;
}
Typography & Visual Style
border-radius rounds the corners of an element. Small radius feels crisp and utilitarian. Large radius feels soft, friendly or app-like.
Radius should be consistent. A site with random corner values can feel messy even when colors and typography are strong.
Large radius may require overflow control when child images or backgrounds should follow the same shape.
Useful for dense tools, inputs and work-focused UI.
Common for cards, panels and modern surfaces.
999px creates capsule buttons and badges.
overflow hidden can make child media follow the corner shape.
Visual model
Typography and visual style are where CSS starts to feel like design. These models turn subjective choices into reusable decisions you can explain, test and improve.
Examples
:root {
--radius-sm: 6px;
--radius-md: 12px;
--radius-lg: 24px;
--radius-pill: 999px;
}
.card { border-radius: 17px; }
.button { border-radius: 31px; }
.input { border-radius: 9px 22px 3px 14px; }
Rules that matter
A beautiful one-off style is not enough. The goal is a visual system that keeps working when the site grows, content changes and new pages are added.
A few reusable values make shapes feel connected.
Sharp corners feel different from soft rounded UI.
Pill shapes work well for buttons, chips and badges.
Use overflow hidden when images need to respect card corners.
Arbitrary radius values are hard to maintain.
Inner corners usually need less radius than outer containers.
Production thinking
Radius changes the personality of an interface. It is subtle, but users feel the difference immediately.
Radius should not reduce recognizable controls or hide focus outlines. Keep interactive states clear.
Use radius tokens and document which components use each token.
Visual polish does not rank directly, but polished interfaces build trust and reduce friction.
Live code lab
The preview runs in an isolated iframe. Links and forms stay inside the practice area, so you can experiment without leaving the lesson.
Mini assignment
Practice assignment
Try it yourself
Self-check
Answer these questions before moving on. If your answer is vague, change the lab values and judge the visual result again.
Senior audit upgrade
Random rounded corners make a product feel stitched together. Tokens keep cards, buttons and inputs related.
--radius-1, --radius-2 and --radius-pill define reusable raw values.
A button and a modal may use different radius roles even if values overlap.
When radius changes by accident, the UI quickly feels lower quality.
Chapter project
Turn fonts, scale, color, backgrounds, gradients, shadows and radius into reusable design choices.
a small visual language with tokens for text, surfaces, accents and depth
Can you explain the product feeling created by your type, color and spacing choices?