Skip to content

Commit 61abddb

Browse files
Update Density foundation (#4910)
Co-authored-by: Zhihao Cui <[email protected]>
1 parent 78eaee3 commit 61abddb

File tree

4 files changed

+32
-215
lines changed

4 files changed

+32
-215
lines changed

site/docs/foundations/density.mdx

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,64 @@ sidebar:
55
priority: 12
66
---
77

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.
99

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)
1111

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).
1313

14-
- High
15-
- Medium
16-
- Low
17-
- Touch
14+
Salt offers 4 densities:
15+
16+
| Density | Use case |
17+
| ------- | -------------------------------------------------------------------------------- |
18+
| 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 |
1822

1923
<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"
2226
/>
2327

2428
## High density (HD)
2529

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.
2731

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+
/>
2936

3037
## Medium density (MD)
3138

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.
3340

3441
## Low density (LD)
3542

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.
3744

3845
## Touch density (TD)
3946

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).
4150

4251
## Mixing densities
4352

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:
4556

4657
- Pick a density and be consistent with it across your application
4758
- 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
5860

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:
6062

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).
63+
- Using typographic hierarchy or weight
64+
- Mixing primary and secondary background colors
65+
- Applying greater spacing between elements
66+
- Scaling components
6267

6368
:fragment{src="./fragments/feedback.mdx"}
11.9 KB
Loading

0 commit comments

Comments
 (0)