--- name: layout-padding description: Controlling element padding with spacing scale, logical properties, and directional utilities --- # Padding Utilities for controlling an element's padding. ## Usage ### All sides Use `p-` to set padding on all sides: ```html
Padding on all sides
Larger padding
``` ### Individual sides Use `pt-`, `pr-`, `pb-`, `pl-`: ```html
Top padding
Right padding
Bottom padding
Left padding
``` ### Horizontal and vertical Use `px-` for horizontal, `py-` for vertical: ```html
Horizontal padding
Vertical padding
``` ### Logical properties Use `ps-` (padding-inline-start) and `pe-` (padding-inline-end) for RTL support: ```html
Left padding in LTR
Right padding in LTR
Right padding in RTL
Left padding in RTL
``` ### Custom values Use arbitrary values for custom padding: ```html
Custom padding
Custom calculation
``` ## Key Points - Spacing scale: `p-0` through `p-96` (and beyond) - Individual: `pt-*`, `pr-*`, `pb-*`, `pl-*` for specific sides - Axes: `px-*` (horizontal), `py-*` (vertical) - Logical: `ps-*` (start), `pe-*` (end) adapt to text direction - No negative padding - padding cannot be negative in CSS - Common patterns: `p-4`, `px-6`, `py-8`, `pt-2`, `pb-4`