A LITTLE CORNER OF MY WORLD

Read a few words, keep a little time

Every moment worth recording has a light of its own.

Back to all posts
Exercise Therapy

A gentler interface: small CSS details

Space, rounded corners, soft shadows, and restrained motion give a page room to breathe.

On this page
  1. Begin with space
  2. A little shadow is enough
  3. Give motion a small role
  4. Make keyboard focus visible
  5. Connect themes with variables

Begin with space

When a card feels crowded, try increasing the gaps between its contents. Group the title with its summary and give separate paragraphs enough distance to show their relationship.

Whitespace helps readers understand how the content fits together. A clear rhythm is useful even on a small screen.

A little shadow is enough

A soft shadow can separate a card from the background. Low opacity and a hint of the theme color help it fit into the page.

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 5px 24px #88566a06;
}

Use the border to define the edge and the shadow to suggest depth.

Give motion a small role

A two pixel lift on hover can signal that something is clickable. Keep transitions brief enough for comfortable reading, and respect the reader’s reduced motion preference:

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card {
    transition: none;
  }
}

Make keyboard focus visible

Keep a clear focus outline for keyboard users. :focus-visible provides a useful way to show the current position during keyboard navigation.

Connect themes with variables

Define backgrounds, cards, text, and accent colors as shared variables. Switching a theme then updates those values consistently across components.

A comfortable interface often comes from refining these small relationships.

✿

Thank you for reading. I hope these words were useful.

Raushan Kumar
Raushan Kumar / Curator

A little code, a little everyday life. Say hello in the guestbook. Guestbook