Category: Spacing

Back to Docs

Navigation

Padding Classes

Padding is space that is added to the inside of a box in the box-model of web design. In ACSS, padding classes add symmetrical, responsive spacing to the inside of a container.

Using Padding Classes

Sometimes boxes need padding and sometimes they don’t. Since there’s no way to predict which boxes need padding and which don’t, padding is not applied to divs and containers by default.

It’s up to you to decide where you need padding and when padding is required, you can easily add it with ACSS padding classes.

The convention for our padding classes is .pad--{size}.

Choices are xs, s, m, l, xl, xxl, and none.

Why isn’t padding directional?

Some utility frameworks provide very granular padding classes so you can apply padding only to one side of an element/container. ACSS avoids this because these situations almost always call for custom classes as a best practice.

Being a strict framework, ACSS doesn’t encourage using utility classes in situations where custom classes are far more appropriate. You should use Automatic’s spacing variables in conjunction with custom classes in these situations instead.