DesignDev
Coarse density
CDS now has a coarse density mode. Set data-density="coarse" and everything inside grows ×1.5 together: text, icons, controls, gaps, corners and touch targets. What you see is what you can tap.
When to use it
Use it where people operate a screen with gloves or at arm’s length, and browser zoom is not available, such as warehouse and kiosk screens. Skip it on regular websites, where the default sizes already suit fingers and mice.
Whole page or one area
Put the attribute on <html> to scale the whole page, or on a container to scale only that area:
<link rel="stylesheet" href="@tmedxp/styleguide/toyota/density.css" />
<form data-density="coarse">...</form>Coarse density costs space: a table shows about a third fewer rows, and wide tables scroll a breakpoint sooner. When a screen mixes controls with dense data, scale the controls and leave the data as it is.
Considerations
- Opt-in. Nothing changes until you load the brand’s
density.cssand set the attribute. - Borders hold. Borders, breakpoints and shadows keep their size; corners scale.
- The factor is yours. It defaults to 1.5; set
--tng-density-scaleon the same element asdata-densityto change it. - In quarantine. It works and you can ship it, but the details may still change.
Read the Density page to get started.