@material/density
Advanced tools
Comparing version 4.0.0-canary.e851d4f40.0 to 4.0.0
124
CHANGELOG.md
@@ -6,2 +6,126 @@ # Change Log | ||
# [4.0.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0) (2019-11-02) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.062ade5c0.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.062ade5c0.0) (2019-10-17) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.735147131.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.735147131.0) (2019-10-16) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.5dc45b82a.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.5dc45b82a.0) (2019-10-16) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.22d7ad2fb.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.22d7ad2fb.0) (2019-10-15) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.199534d61.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.199534d61.0) (2019-09-27) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
* **radio:** Add density mixin to radio ([#5118](https://github.com/material-components/material-components-web/issues/5118)) ([199534d](https://github.com/material-components/material-components-web/commit/199534d)) | ||
### BREAKING CHANGES | ||
* **radio:** In Checkbox, Renamed sass variables `$mdc-radio-touch-area` => `$mdc-radio-ripple-size` & `$mdc-radio-ui-size` => `$mdc-radio-icon-size` to be consistent with checkbox. Also, removed `$mdc-radio-ui-pct` sass variable. | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.905884690.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.905884690.0) (2019-09-16) | ||
### Features | ||
* **density:** Add density subsystem to components ([#5059](https://github.com/material-components/material-components-web/issues/5059)) ([73a5e4c](https://github.com/material-components/material-components-web/commit/73a5e4c)) | ||
### BREAKING CHANGES | ||
* **density:** Renamed sass mixins & variables in MDC Data Table - `mdc-data-table-header-row-height` => `mdc-data-table-header-cell-height` & `mdc-data-table-row-height` => `mdc-data-table-cell-height`. Also removed `mdc-button--dense` variant, use button's density mixin instead. | ||
# [4.0.0-canary.e851d4f40.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.e851d4f40.0) (2019-09-13) | ||
@@ -8,0 +132,0 @@ |
{ | ||
"name": "@material/density", | ||
"description": "Density utilities for Material Components for the web", | ||
"version": "4.0.0-canary.e851d4f40.0", | ||
"version": "4.0.0", | ||
"license": "MIT", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "353401bd143fdc2b4a85abf330176228e21dfe13" | ||
"gitHead": "8fcbb009cd3b5cc004b302613dd55ab4b5d6ef72" | ||
} |
@@ -11,4 +11,15 @@ <!--docs: | ||
Density subsystem provides adaptive layout to components. | ||
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. | ||
## Design & API Documentation | ||
<ul class="icon-list"> | ||
<li class="icon-list-item icon-list-item--spec"> | ||
<a href="https://material.io/design/layout/applying-density.html">Material Design guidelines: Applying density</a> | ||
</li> | ||
<li class="icon-list-item icon-list-item--link"> | ||
<a href="https://glitch.com/~material-density" target="_blank">Demo: Glitch</a> | ||
</li> | ||
</ul> | ||
## Installation | ||
@@ -20,9 +31,6 @@ | ||
> NOTE: You do not need to directly depend on `@material/density`, use component provided density Sass mixins instead. | ||
## Basic Usage | ||
### Styles | ||
This package is used as utility for other components' density mixins. Mixin provided by this package is not intended to | ||
be consumed directly by developers, use component's density mixin instead. | ||
The styles for applying density to button component instance looks like this: | ||
@@ -34,2 +42,3 @@ | ||
.my-custom-button { | ||
// Sets button density scale to `-3`, i.e. button height to `24px`. | ||
@include mdc-button-density(-3); | ||
@@ -44,4 +53,56 @@ } | ||
Here are the components that do provide density Sass mixins: | ||
* [Button](../mdc-button/README.md#sass-mixins) | ||
* [Checkbox](../mdc-checkbox/README.md#sass-mixins) | ||
* [Chip](../mdc-chips/README.md#sass-mixins) | ||
* [Data Table](../mdc-data-table/README.md#sass-mixins) | ||
* [Icon Button](../mdc-icon-button/README.md#sass-mixins) | ||
* [List](../mdc-list/README.md#sass-mixins) | ||
* [Radio](../mdc-radio/README.md#sass-mixins) | ||
* [Switch](../mdc-switch/README.md#sass-mixins) | ||
* [Tab Bar](../mdc-tab-bar/README.md#sass-mixins) | ||
* [Text Field](../mdc-textfield/README.md#sass-mixins) | ||
## Density Mixins | ||
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). | ||
Currently, the density system only allows negative numbers to customize for high density. The lower the density scale, the higher the component density. The exact density scale range depends on the component. If the scale number is unsupported by the component density mixin, the compiler will report an error at build time. | ||
The height or size of a component is calculated with the following formula: | ||
```scss | ||
$height: $mdc-button-height + $mdc-density-interval * $density-scale | ||
/// @example 36px + 4px * (-3) => 24px | ||
``` | ||
The density interval is set to 4px for visual consistency. | ||
It is recommended to customize density via the provided density mixins, rather than arbitrarily applying component height. | ||
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. | ||
## Component variants | ||
Components that has different variants may have their own density mixin. | ||
For example, Tab Bar has two density mixins: | ||
* `mdc-tab-bar-density()`: Density mixin for standard tab bar. | ||
* `mdc-tab-bar-stacked-density()`: Density mixin for tab bar that has icon stacked on top of label. | ||
Similarly, text field provides 3 different density mixins based on its variant. | ||
## Nested components | ||
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. | ||
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. | ||
## Style Customization | ||
This package is used as utility for other components' density mixins. Customizations provided by this package is not intended to | ||
be consumed directly by developers, use component's density mixin instead. | ||
### Sass Variables | ||
@@ -48,0 +109,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
35716
1
118