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

Density utilities for Material Components for the web


Version published
Weekly downloads
727K
decreased by-20.3%
Maintainers
17
Weekly downloads
 
Created
Source

Density

Density subsystem provides adaptive layout to components.

Installation

npm install @material/density

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:

@import "@material/button/mixins";

.my-custom-button {
  @include mdc-button-density(-3);
}

This would apply -3 (high density) to button component instance.

You would indirectly use the Density API through respective component's mixin which takes care of setting appropriate component height.

Style Customization

Sass Variables

VariableDescription
$mdc-density-intervalDensity interval between each dense scale. This interval is used for numbered density scale to calculate dense height based on baseline component height.
$mdc-density-minimum-scaleMinimum scale supported by density subsystem. This scale always maps to highest dense scale.
$mdc-density-maximum-scaleMaximum scale supported by density subsystem. This scale always maps to lowest dense scale.
$mdc-density-supported-scalesSupported density scale when density literal is used (For example, minimum).

Sass Functions

FunctionDescription
mdc-density-prop-value($density-config, $density-scale, $property-name)Returns component property value based on given density config and density scale.

Keywords

FAQs

Package last updated on 15 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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