14.0.12 • Published 2 years ago

@nicolabello/material-components-web v14.0.12

Weekly downloads
24
License
MIT
Repository
github
Last release
2 years ago

Material Components Web (MDC Web)

This package has been forked from the original Google project material-components-web.

All the internal imports have been transformed to relative to make importing the library easier, without the need of adding includePath to the SASS compiler options.

Installation

npm install @nicolabello/material-components-web

or

yarn add @nicolabello/material-components-web

Usage

Including the Sass

The default icons and typography require to include Material Design Icons and Roboto font

// Material design icons
@import "https://fonts.googleapis.com/icon?family=Material+Icons";

// Roboto font
@import "https://fonts.googleapis.com/css?family=Roboto:300,400,500";

To import the style for all the available components do as following

// All components
@use "~@nicolabello/material-components-web/styles";

To import only the style for specific components do as following

// Button
@use "~@nicolabello/material-components-web/button/mdc-button";

// Chips
@use "~@nicolabello/material-components-web/chips/mdc-chips";

To access variables, mixins and functions do as following

// All components variables, mixins and functions
@use "~@nicolabello/material-components-web/members";

// Button variables, mixins and functions
@use "~@nicolabello/material-components-web/button";

.my-class {
  height: members.$button-height;
  // Equivalent to
  height: button.$height;
}

.my-other-clss{
  @include members.button-ink-color(red);
  // Equivalent to
  @include button.ink-color(red);
}

If you are unfamiliar with the syntax, read about Sass Modules.

Please note: the ~ at the start of the imports paths tells the Webpack loader to resolve the import from the node_modules path.

Including the JavaScript

import { MDCCheckbox } from '@nicolabello/material-components-web';
const checkbox = new MDCCheckbox(document.querySelector('.mdc-checkbox'));

Documentation

Please note that the imports in the documentation must be replaced as following:

  • @material/ -> ~@nicolabello/material-components-web/ for Sass imports
  • @material/ -> @nicolabello/material-components-web/ for JavaScript and TypeScript imports
14.0.12

2 years ago

14.0.11

2 years ago

14.0.10

2 years ago

13.0.14

2 years ago

13.0.13

2 years ago

13.0.11

2 years ago

13.0.12

2 years ago

13.0.10

3 years ago

13.0.0

3 years ago

11.0.12

3 years ago

11.0.11

3 years ago

10.0.10

3 years ago

9.0.10

3 years ago

8.0.17

3 years ago

8.0.16

3 years ago

8.0.15

3 years ago

8.0.12

3 years ago

8.0.14

3 years ago

8.0.11

3 years ago

8.0.10

3 years ago

7.0.10

4 years ago

6.0.11

4 years ago

6.0.10

4 years ago

5.1.1012

4 years ago

5.1.1011

4 years ago

5.1.1010

4 years ago

5.1.109

4 years ago

5.1.107

4 years ago

5.1.106

4 years ago

5.1.105

4 years ago

5.1.103

4 years ago

5.1.104

4 years ago

5.1.102

4 years ago

5.1.101

4 years ago

5.1.0

4 years ago