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: site/docs/foundations/density.mdx
+32-27Lines changed: 32 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,59 +5,64 @@ sidebar:
5
5
priority: 12
6
6
---
7
7
8
-
Density relates to the amount of content that can fit on a screen based on the [size](./size)and [spacing](./spacing) of components.
8
+
Density relates to the amount of content that can fit on a screen based on the size and spacing of components. Choose a base density as a starting point when creating a product using Salt. All components, spacing, and typographic elements will align and remain proportionate regardless of the density you choose. Density can be changed at a page or region level. For more information about mixing densities, please refer to the [mixing densities section](#mixing-densities) on this page.
9
9
10
-
When creating a product using the design system, choose a base density as a starting point. All components, spacing, and typographic elements will align and remain proportionate regardless of the density you choose.
10
+
To learn how to change Salt density with Figma variables, watch [our demo video](https://go/techtube/#/videos/c7717cb0-4332-4cf0-9c8c-7f66e5eaf339) by the design team. (Internal users only)
11
11
12
-
There are four densities available to choose from:
12
+
For information on how to implement density in code, you can learn more on the [Salt provider page](/salt/components/salt-provider/examples#density).
| High | Optimized for data-heavy or complex applications such as trading platforms |
19
+
| Medium | Optimized for standard applications and websites at default density |
20
+
| Low | Optimized for data/content-light interfaces such as marketing and communications |
21
+
| Touch | Optimized for touch interactions in mobile and tablet devices |
18
22
19
23
<Image
20
-
src="/img/foundations/density-example.svg"
21
-
alt="Example of all densities side-by-side"
24
+
src="/img/foundations/density-buttons.png"
25
+
alt="Example of Button in all densities side-by-side"
22
26
/>
23
27
24
28
## High density (HD)
25
29
26
-
High density scales components down to their smallest size and reduces the size between elements to ensure a compact layout.
30
+
High density scales components down to their smallest size and reduces the size between elements to ensure a compact layout. High density is designed for frequent application use by experienced users.
27
31
28
-
High density is optimized for data-heavy or complex applications, such as trading platforms. It is optimized for frequent use by experienced power users.
32
+
<Image
33
+
src="/img/foundations/density-skeletons.png"
34
+
alt="Example of Dialog skeleton in high density and medium density side-by-side"
35
+
/>
29
36
30
37
## Medium density (MD)
31
38
32
-
Medium density is the default solution for most use cases. It is ideal for most standard applications or content-rich websites.
39
+
Medium density is the default solution for most use cases. It's ideal for most standard applications or content-rich websites.
33
40
34
41
## Low density (LD)
35
42
36
-
Low density is optimized for content-light interfaces. It's ideal for marketing, communications, or onboarding experiences. In contrast to 'high density', low density is intended for infrequently used applications by inexperienced users.
43
+
Low density is optimized for content-light interfaces. It's ideal for marketing, communications, or onboarding experiences. In contrast to high density, low density is intended for infrequently used applications by inexperienced users.
37
44
38
45
## Touch density (TD)
39
46
40
-
Touch density scales components to their largest increment and is intended for mobile or tablet devices only.
47
+
Touch density’s main purpose is to address accessibility concerns on smaller viewports that deal with higher resolutions. When a screen has a higher resolution, touch targets are adjusted to remain large enough for easy interaction.
48
+
49
+
For more information on how to adjust typography and spacing in TD, please refer to the [small viewports page](/salt/foundations/small-viewports).
41
50
42
51
## Mixing densities
43
52
44
-
Density is intended to be used one density at a time, only changing when part of a [responsive layout](./responsiveness). When applying density:
53
+
Density is intended to be used one at a time, only changing when part of a responsive breakpoint. To learn more about densities at various breakpoints, please refer to the [breakpoints page](/salt/foundations/breakpoints).
54
+
55
+
When applying density:
45
56
46
57
- Pick a density and be consistent with it across your application
47
58
- Alternatively, set density to align to breakpoints and define which density to use per breakpoint
48
-
- If the use case requires it, mix densities, but do it sparingly in order to provide greater emphasis to a single component or small group of components, such as log-in fields.
49
-
50
-
The [Responsiveness](./responsiveness) foundation includes guidance on recommended breakpoints for each density.
51
-
52
-
Before mixing densities, consider other ways to establish hierarchy or emphasise certain elements, such as:
53
-
54
-
- Using typographic hierarchy or weight.
55
-
- Mixing primary and secondary background colors.
56
-
- Applying greater spacing between elements.
57
-
- Scaling components.
59
+
- If the use case requires it, you can mix densities only at a regional level and not at a component level
58
60
59
-
If you still need to mix densities, do it sparingly. Although possible, the components within the system are not designed to be mixed. This does not mean they can't be mixed, but they are designed around a specific scaling system that ensures components of the same density align. The components are not designed to 'fit' together across densities.
61
+
Before mixing densities, consider other ways to establish hierarchy or emphasise certain elements:
60
62
61
-
Mixing the density of components sparingly can help to create emphasis without visual disruption. However, if overused, there may be issues with component alignment and use of [spacing tokens](./spacing).
0 commit comments