Socket
Socket
Sign inDemoInstall

@material/density

Package Overview
Dependencies
Maintainers
17
Versions
1643
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/density - npm Package Compare versions

Comparing version 4.0.0-canary.5916d18c.0 to 4.0.0-canary.62d3a09b.0

7

CHANGELOG.md

@@ -6,7 +6,4 @@ # Change Log

# 4.0.0-canary.5916d18c.0 (2019-10-18)
# 4.0.0-canary.62d3a09b.0 (2019-11-01)
### Bug Fixes
* **ripple:** Remove unnecessary overflow: hidden. ([#5191](https://github.com/material-components/material-components-web/issues/5191)) ([5916d18](https://github.com/material-components/material-components-web/commit/5916d18))
**Note:** Version bump only for package @material/density
{
"name": "@material/density",
"description": "Density utilities for Material Components for the web",
"version": "4.0.0-canary.5916d18c.0",
"version": "4.0.0-canary.62d3a09b.0",
"license": "MIT",

@@ -20,3 +20,3 @@ "keywords": [

},
"gitHead": "e3338b891c5ab3207ef8340a75490415e30e313a"
"gitHead": "e00a9686a58b0fd5ec957d4008b6674dafd4dad2"
}

@@ -11,3 +11,3 @@ <!--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.

@@ -20,9 +20,6 @@ ## Installation

> 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 +31,3 @@

.my-custom-button {
// Sets button density scale to `-3`, i.e. button height to `24px`.
@include mdc-button-density(-3);

@@ -44,4 +42,26 @@ }

## 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.
## 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 +68,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc