You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/support/spacing.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,20 @@ The spacing scale is a **base-8** scale. We chose a base-8 scale because eight i
24
24
25
25
These variables are encouraged to be used within components and custom CSS. The spacing scale is also used for [margin](/utilities/margin) and [padding](/utilities/padding) utilities.
26
26
27
-
See [primer-marketing-support](/support/marketing-variables) for the extended spacing scale used for marketing needs and the related y-axis spacing utilities for [margin](/utilities/marketing-margin) and [padding](/utilities/marketing-padding).
27
+
### Extended spacing scale
28
+
29
+
These are primarily useful for achieving bigger vertical spacing between sections. This scale first steps up with `8px` for spacer 7, then steps in increments of `16px` from spacer 8 up to 12.
30
+
31
+
| Variable | Scale | Value |
32
+
| ------------ |-------|-------|
33
+
|`$spacer-7`| 7 | 48px |
34
+
|`$spacer-8`| 8 | 64px |
35
+
|`$spacer-9`| 9 | 80px |
36
+
|`$spacer-10`| 10 | 96px |
37
+
|`$spacer-11`| 11 | 112px |
38
+
|`$spacer-12`| 12 | 128px |
39
+
40
+
The extended spacing scale is used for [margin](/utilities/margin) and [padding](/utilities/padding) utilities along the Y-axis, as well as for single side spacing utilities (top, right, bottom, left).
Copy file name to clipboardExpand all lines: docs/content/utilities/margin.md
+68-37Lines changed: 68 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,43 +9,47 @@ bundle: utilities
9
9
Margin utilities are based on a global [spacing scale](/support/spacing) which helps keep horizontal and vertical 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.
10
10
11
11
12
-
13
12
## Naming convention
14
13
15
14
Since margin utilities have many variations and will be used in many places, we use a shorthand naming convention to help keep class names succinct.
16
15
17
16
18
17
| Shorthand | Description |
19
18
| --- | --- |
20
-
| m | margin |
21
-
| t | top |
22
-
| r | right |
23
-
| b | bottom |
24
-
| l | left |
25
-
| x | horizontal, left & right |
26
-
| y | vertical, top & bottom |
27
-
| 0 | 0 |
28
-
| 1 | 4px |
29
-
| 2 | 8px |
30
-
| 3 | 16px |
31
-
| 4 | 24px |
32
-
| 5 | 32px |
33
-
| 6 | 40px |
34
-
19
+
| m | margin |
20
+
| t | top |
21
+
| r | right |
22
+
| b | bottom |
23
+
| l | left |
24
+
| x | horizontal, left & right |
25
+
| y | vertical, top & bottom |
26
+
| 0 | 0 |
27
+
| 1 | 4px |
28
+
| 2 | 8px |
29
+
| 3 | 16px |
30
+
| 4 | 24px |
31
+
| 5 | 32px |
32
+
| 6 | 40px |
33
+
| 7 | 48px |
34
+
| 8 | 64px |
35
+
| 9 | 80px |
36
+
| 10 | 96px |
37
+
| 11 | 112px |
38
+
| 12 | 128px |
35
39
36
40
## Uniform margins
37
41
38
42
Use uniform spacing utilities to apply equal margin to all sides of an element. These utilities can change or override default margins, and can be used with a spacing scale from 0-6.
Reset margins built into typography elements or other components with `m-0`, `mt-0`, `mr-0`, `mb-0`, `ml-0`, `mx-0`, and `my-0`.
79
96
80
97
```html live
81
-
<divclass="bg-yellow border">
82
-
<pclass="mb-0 bg-gray p-1">No bottom margin on this paragraph.</p>
98
+
<divclass="color-bg-warning border">
99
+
<pclass="mb-0 color-bg-secondary p-1">No bottom margin on this paragraph.</p>
83
100
</div>
84
101
```
85
102
@@ -88,23 +105,37 @@ Reset margins built into typography elements or other components with `m-0`, `mt
88
105
All margin utilities can be adjusted per [breakpoint](/objects/grid#breakpoints) using the following formula: `m[direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.
You can add negative margins to the top, right, bottom, or left of an item by adding a negative margin utility. The formula for this is: `m[direction]-n[spacer]`. This also works responsively, with the following formula: `m[direction]-[breakpoint]-n[spacer]`.
117
+
You can add negative margins to the top, right, bottom, or left of an item by adding a negative margin utility. The formula for this is: `m[direction]-n[spacer]`, where `spacer` runs from `1` to `6`. This also works responsively, with the following formula: `m[direction]-[breakpoint]-n[spacer]`.
Copy file name to clipboardExpand all lines: docs/content/utilities/marketing-layout.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ In an effort to reduce the size of our CSS, responsive breakpoints are only supp
29
29
30
30
## Negative offset columns
31
31
32
-
Using column offset classes can pull a div over X number of columns to the left. Negative offsets are available in [spacings from 1](../support/spacing/#spacing-scale)[to 7](../support/marketing-variables/).
32
+
Using column offset classes can pull a div over X number of columns to the left. Negative offsets are available in [spacings from 1](../support/spacing/#spacing-scale)[to 7](../support/spacing/#extended-spacing-scale).
The extended directional padding scale starts from spacer `7` and goes up to `12`. All directions and their responsive variants are supported, except for `px`.
All padding utilities can be adjusted per [breakpoint](/support/breakpoints) using the following formula: <br /> `p-[direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.
0 commit comments