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: ui/utilities/margin/docs.mdx
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,23 @@ import Example from '../../../shared/components/Example';
3
3
4
4
<divclassName="lead">Adjust whitespace by applying horizontal and vertical margin helpers</div>
5
5
6
-
The base unit of all our spacing metrics is **4**.
6
+
The base unit of all of our spacing metrics is **4**.
7
7
8
8
**Before using**
9
+
9
10
- Most components already come with spacing included. These utility classes are for added convenience in laying out components.
10
-
- Classes prefixed by `.slds-m-` are used for adding **margins**. Classes prefixed in `.slds-p-` are used for adding **padding**
11
+
- Classes prefixed by `slds-m-` are used for adding **margins**. Classes prefixed in `slds-p-` are used for adding [padding](/components/utilities/padding)
11
12
- The directions available for the spacing classes are `top`, `right`, `bottom`, and `left`.
12
13
- You can use the `vertical` shortcut for both `top` and `bottom`, `horizontal` for both `right` and `left`, and `around` for all sides.
13
14
- Use the `_xxx-small` through `_xx-large` scale to choose the size needed.
14
-
- Where **vertical centering** is required, check out our [/components/utilities/media-objects/#center](centered media object) instead of applying extra `margin` or `padding`.
15
+
- You can also use `none` as the size on any of the directions to enforce zero margin.
16
+
- Where **vertical centering** is required, check out our [centered media object](/components/utilities/media-objects/#center) instead of applying extra `margin` or `padding`.
15
17
16
18
## Location - Top
19
+
17
20
<Exampletitle="top margins">
18
21
<div>
22
+
<Marginsize="none"position="top" />
19
23
<Marginsize="xxx-small"position="top" />
20
24
<Marginsize="xx-small"position="top" />
21
25
<Marginsize="x-small"position="top" />
@@ -28,8 +32,10 @@ The base unit of all our spacing metrics is **4**.
28
32
</Example>
29
33
30
34
## Location - Left
35
+
31
36
<Exampletitle="left margins">
32
37
<div>
38
+
<Marginsize="none"position="left" />
33
39
<Marginsize="xxx-small"position="left" />
34
40
<Marginsize="xx-small"position="left" />
35
41
<Marginsize="x-small"position="left" />
@@ -42,8 +48,10 @@ The base unit of all our spacing metrics is **4**.
42
48
</Example>
43
49
44
50
## Location - Bottom
51
+
45
52
<Exampletitle="bottom margins">
46
53
<div>
54
+
<Marginsize="none"position="bottom" />
47
55
<Marginsize="xxx-small"position="bottom" />
48
56
<Marginsize="xx-small"position="bottom" />
49
57
<Marginsize="x-small"position="bottom" />
@@ -56,8 +64,10 @@ The base unit of all our spacing metrics is **4**.
56
64
</Example>
57
65
58
66
## Location - Right
67
+
59
68
<Exampletitle="right margins">
60
69
<div>
70
+
<Marginsize="none"position="right" />
61
71
<Marginsize="xxx-small"position="right" />
62
72
<Marginsize="xx-small"position="right" />
63
73
<Marginsize="x-small"position="right" />
@@ -70,8 +80,10 @@ The base unit of all our spacing metrics is **4**.
70
80
</Example>
71
81
72
82
## Location - Horizontal
83
+
73
84
<Exampletitle="horizontal margins">
74
85
<div>
86
+
<Marginsize="none"position="horizontal" />
75
87
<Marginsize="xxx-small"position="horizontal" />
76
88
<Marginsize="xx-small"position="horizontal" />
77
89
<Marginsize="x-small"position="horizontal" />
@@ -84,8 +96,10 @@ The base unit of all our spacing metrics is **4**.
84
96
</Example>
85
97
86
98
## Location - Vertical
99
+
87
100
<Exampletitle="vertical margins">
88
101
<div>
102
+
<Marginsize="none"position="vertical" />
89
103
<Marginsize="xxx-small"position="vertical" />
90
104
<Marginsize="xx-small"position="vertical" />
91
105
<Marginsize="x-small"position="vertical" />
@@ -98,8 +112,10 @@ The base unit of all our spacing metrics is **4**.
0 commit comments