Git Product home page Git Product logo

material-utilities's Introduction

Material Utilities

A set of CSS custom variables & classes to bring Material shadows and opacities to your project.

npm npm gzip size size

SCSS snippet featuring Material Utilities

If you're looking for the Material color palette, head over to shuhei/material-colors.

Inspired by colors.

Install

$ npm install material-utilities

Tip: use the --production flag to only install the "dependencies" (so without the "devDependencies").

Usage

PostCSS

Import the module

@import "~material-utilities/src/material-utilities.css";

Use the CSS custom property matching the shadow/opacity you want

.card {
  box-shadow: var($shadow-1);
}
.divider {
  color: var($dark-opacity-1);
}

Note: You'll need a PostCSS plugins that features CSS Custom Properties and @import. I recommand cssnext.

SCSS

Import the module

@import "~material-utilities/dist/classes.scss";
@import "~material-utilities/dist/variables.scss";

Use the SCSS variable matching the shadow/opacity you want

.card {
  box-shadow: var(--shadow-1);
}
.divider {
  color: var(--dark-opacity-1);
}

CSS

Just add the following link in your html

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/material-utilities.min.css">
<!-- If you use a build tool like Gulp to concatenate your stylesheets, you should use
<link rel="stylesheet" href="path/to/module/material-utilities.min.css">
-->

Use the class matching the shadow/opacity you want

<button class="shadow-1 shadow-transition shadow-5-hover">Download</button>

Contribute

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Install dependencies using npm npm install or Yarn: yarn install.
  3. Make the necessary changes.
  4. Send a pull request.

License

MIT © Maxime Le Conte des Floris

material-utilities's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.