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: packages/mdc-density/README.md
+42-1
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,24 @@ path: /catalog/density/
10
10
11
11
Density subsystem provides adaptive layout to components. Material Design uses low-density space by default but offers high-density space when it improves the user experience. Components with high density enable users to process and take action against large amounts of information in a more manageable way. List, tables, and long forms are components that benefit from increased density.
Components that supports density provides Sass mixins to customize density for that component. Each density mixin takes in a density scale number, e.g. 0 (the default) or -1 (higher density).
@@ -55,6 +79,23 @@ It is recommended to customize density via the provided density mixins, rather t
55
79
56
80
NOTE: Touch targets are automatically disabled when density mixins are applied, since dense components should be optionally enabled and therefore do not have the same default accessibility requirements.
57
81
82
+
## Component variants
83
+
84
+
Components that has different variants may have their own density mixin.
85
+
86
+
For example, Tab Bar has two density mixins:
87
+
88
+
* `mdc-tab-bar-density()`: Density mixin for standard tab bar.
89
+
* `mdc-tab-bar-stacked-density()`: Density mixin for tab bar that has icon stacked on top of label.
90
+
91
+
Similarly, text field provides 3 different density mixins based on its variant.
92
+
93
+
## Nested components
94
+
95
+
Material component that renders another component inside it needs set its own density scale accordingly. Applying density mixin on parent component does not automatically apply density to its children.
96
+
97
+
For example, Applying density to data table does not automatically set density scale to row checkbox. You'll have to explicitly set density scale to its children. This'll allow clients to have full control on the layout.
98
+
58
99
## Style Customization
59
100
60
101
This package is used as utility for other components' density mixins. Customizations provided by this package is not intended to
0 commit comments