Skip to content

Commit 62a10ba

Browse files
committed
Add scaffold docs
1 parent ed3daac commit 62a10ba

File tree

2 files changed

+44
-0
lines changed
  • docs

2 files changed

+44
-0
lines changed

docs/content/utilities/gap.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Gap
3+
path: utilities/gap
4+
status: Stable
5+
source: 'https://github.com/primer/css/blob/main/src/utilities/gap.scss'
6+
bundle: utilities
7+
---
8+
9+
Gap utilities can be used on elements with a display type of `flex` or `grid` to create consistent gaps between child elements. This can replace the need for using margins in many cases.
10+
11+
Gap utilities are based on a global [spacing scale](/support/spacing) which helps keep spacing consistent. These utilities help us reduce the amount of custom CSS that share the same properties, and allows to achieve many different page layouts using the same styles.
12+
13+
14+
## Naming convention
15+
16+
Since gap utilities have many variations and will be used in many places, we use a shorthand naming convention to help keep class names succinct.
17+
18+
| Shorthand | Description |
19+
| --- | --- |
20+
| g | gap |
21+
| 0 | 0 |
22+
| 1 | 4px |
23+
| 2 | 8px |
24+
| 3 | 16px |
25+
| 4 | 24px |
26+
| 5 | 32px |
27+
| 6 | 40px |
28+
| 7 | 48px |
29+
| 8 | 64px |
30+
| 9 | 80px |
31+
| 10 | 96px |
32+
| 11 | 112px |
33+
| 12 | 128px |
34+
35+
36+
## Reset gap
37+
Reset gap values built into components with `g-0`.
38+
39+
40+
## Responsive gaps
41+
42+
All gap utilities can be adjusted per [breakpoint](/utilities/grid#breakpoints) using the following formula: `g-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.

docs/src/@primer/gatsby-theme-doctocat/nav.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
url: /utilities/margin
4040
- title: Padding
4141
url: /utilities/padding
42+
- title: Gap
43+
url: /utilities/gap
4244
- title: Typography
4345
url: /utilities/typography
4446
- title: Components

0 commit comments

Comments
 (0)