Marcus Andrey Study
Ler em português Library

Visual design · Step 5 · 7 min read

Corners, borders and shadows with a rule

Border radius, borders and shadows are not decorative choices. Each communicates elevation — the perceived position of a component on the Z axis. This lesson gives you a rule that keeps the three consistent across every component.

Three plates float at three elevations — surface, card, floating. As elevation rises, corner radius grows: one rule ties both. Point at a plate to lift it. Illustration: Marcus Andrey, drawn with Hairline (MIT, Lucas Marques).

Corner radius, borders and shadows are not aesthetic choices — they are ways to communicate elevation consistently.

What you'll be able to do after reading:

  • Apply a consistent elevation rule to any component
  • Choose the right border-radius for inputs, cards and modals
  • Decide when a shadow is appropriate and at which level
  • Distinguish decorative from functional use of these properties
  • Spot elevation errors when reviewing another designer's work

1. What elevation means

A screen is flat. What it can do is create the convention that some elements are closer to the viewer — floating above the surface, interrupting the page, or sitting flush on it. That perceived position on the Z axis is what this lesson calls elevation — communicated visually by shadow and border.

Elevation has nothing to do with aesthetics. A modal is elevated because it interrupts everything behind it, and the visual treatment must communicate that interruption. An input field is not elevated because it belongs to the surface, like a word in a printed form. A dropdown floats above the content that triggered it, so it gets a small lift.

Three CSS properties communicate elevation in a UI: border-radius, box-shadow and border. Treating them as style choices — picking values that "look right" — produces inconsistency. Treating them as elevation signals produces a system that reads without explanation.


2. The elevation rule

Each component sits at one of three elevations, and each elevation has a fixed set of values.

Elevation Component examples Border-radius Shadow Border
Surface (0) Table cells, inputs, inline buttons 4px none 1px
Floating (1) Dropdowns, tooltips, hover cards 4px Level 1 none
Interrupting (2) Modals, drawers, dialogs 8px (or 0 full-width) Level 2 none

The logic: a component on the surface is bounded by a border, not a shadow — it has no lift. A floating component gets shadow instead; the boundary is the shadow itself. An interrupting component gets a larger, softer shadow to signal that it has broken the user's flow.

When every component in the system follows this rule, the interface reads without effort. Flat means on the surface. Shadowed means floating. Deeply shadowed means interrupting.


3. Border-radius: position, not personality

Border-radius communicates containment and boundary. The practical rule is: the smaller and tighter the component, the smaller the radius.

A 4px radius on an input field fits neatly inside a form row. It is contained and dense. An 8px radius on a card signals that the card is a self-contained unit with more visual breathing room. A full-width modal gets 0 radius because it has no floating boundary — it replaces the entire surface edge to edge. Rounding those corners would make it look like it had detached from the viewport.

Gale's values:

  • 4px: inputs, table cells, chips, inline icon buttons — contained, tight
  • 8px: cards, panels, side sheets — larger, self-contained components (Interrupting level)
  • 0: full-width modals, bottom sheets that span the viewport width

One rule applies in every case: all corners of the same component get the same value. A card with 8px top corners and 4px bottom corners reads as a mistake, not a decision. If a component has border-radius, it is uniform.


4. Shadows: level 1 and level 2

Shadow communicates lift. The more a component lifts from the surface, the larger and softer the shadow. Two levels cover all the cases in a dense product UI.

Level 1 — floating: A small, tight shadow. Used when a component appears above the surface in response to an action — a dropdown opening, a tooltip appearing. The component is still closely related to what triggered it. Gale's value: 0 1px 2px oklch(0.14 0.015 240 / 0.08).

Level 2 — interrupting: A larger, softer shadow. Used when a component takes the user out of their current context — a modal confirming a destructive action, a side drawer showing full details. The component breaks the current flow. Gale's value: 0 4px 12px oklch(0.14 0.015 240 / 0.12).

The shadow color matters as much as the values. Gale uses oklch(0.14 0.015 240) — the darkest neutral in the palette, slightly blue-shifted to harmonize with the product's hue. At low opacity it reads as a physical shadow, not a dark fill. Using a neutral grey (rgba(0,0,0,0.x)) works but reads as a template choice, not a product decision.

Three things follow from this. First, the shadow color should come from your palette, not from a boilerplate stack. Second, never add shadow to a component at elevation 0; a shadowed table cell looks like a rendering bug. Third, if the urge to add a "Level 3" arises for something that feels extra important, that component is probably doing too much.


5. Borders: separation without lift

A 1px border communicates boundary without elevation. It says "this component is distinct" without saying "this component is above". Use it for inputs, table cells and containers that live flush on the surface.

The practical rule: shadows and borders rarely appear on the same component. An input field has a border and no shadow. A dropdown has a shadow and no border — the shadow creates the boundary. A modal at Level 2 has a shadow and no border.

The one exception is state. A selected row in Gale Console gains a 2px Gale Blue border to signal selection. That is a state change, not an elevation change. The row stays on the surface; the border changes color.

Surface · 0
Work order
In progress
border-radius 4px border 1px shadow none
Floating · 1
Work order
In progress
border-radius 4px border none shadow L1
Interrupting · 2
Work order
In progress
border-radius 8px border none shadow L2
The same component at three elevation levels. Surface (0): a 1px border creates the boundary, no shadow, 4px radius. Floating (1): Level 1 shadow replaces the border, same 4px radius. Interrupting (2): Level 2 shadow signals a context break, 8px radius. Shadow and radius values follow Gale's elevation rule. Diagram: Marcus Andrey, CC BY 4.0.

With the elevation rule in place, the next detail is icons: style, size and optical alignment.


6. Common mistakes

  • Adding shadow to surface-level components (table cells, inline chips) because they look "boring" at Level 0
  • Mixing 4px and 8px radius in the same modal or card, thinking it matches internal content
  • Adding three or more shadow levels, then needing a fourth for the "most important" modal
  • Defining shadow as box-shadow: 0 2px 8px rgba(0,0,0,0.15) without matching the shadow color to the palette hue — it reads as a paste from a template
  • Applying 0 border-radius to all components because "flat design means no radius"

7. Vocabulary

Term Meaning
Elevation The perceived position of a component on the Z axis, communicated by shadow and border

8. Try it (no tools needed)

  1. Open any app you use daily that has both a dropdown (a select menu, an autocomplete) and a modal (a confirmation dialog, a form in an overlay).
  2. Screenshot one dropdown and one modal.
  3. For each, record three things: does it have a shadow, a border, or both? What is its border-radius? How large and soft is the shadow, if any?
  4. Draw a 2×3 table: rows = dropdown and modal, columns = shadow / border / radius. Fill it in.
  5. Check: does the modal have a larger, softer shadow than the dropdown? If both have the same shadow, write what would change to follow the elevation rule.

The goal is a completed table and one observation: "The modal has [value X]. If the elevation rule applied, it would need [change Y]."


9. If you already practise

  • Use the elevation rule as a critique lens: before commenting on a shadow value, ask "what elevation is this component at?" It shifts the conversation from taste to function.
  • The shadow color choice matters. Tinting it slightly with your product's hue (as Gale does with the blue-shifted neutral) removes the generic look at almost no cost.
  • For accessibility: shadow alone cannot communicate a focused state to keyboard users. A visible focus ring is always required. That topic is in Visual states: hover, focus and disabled.
  • If your product uses a dark-mode surface, revisit shadow values — dark surfaces diffuse light differently, and low-opacity shadows may need their oklch L values raised slightly to remain visible.

Checklist


Learn more


Books, courses and videos to go deeper

Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.

Icons: style, size and optical alignment · Density and touch targets · Visual consistency across components · Visual states: hover, focus and disabled

Saved only on this device.

↑ ↓ to move · Enter to open · Esc to close