Giter Club home page Giter Club logo

material-shadows's Introduction

Material Design Shadows

The paper shadows, based on Google's Material Design, for use in your project.

Support

Support for all popular css preprocessors: Less, Sass and Stylus.

Installation

  • Download the files you need from the this repository;
  • Bower: $ bower install material-shadows --save;
  • Git: $ git clone git://github.com/mrmlnc/material-shadows.git;

How to use

Just import the file, which includes mixins in your project.

Less:

  @import "lib/material-shadows";

Sass:

  @import "lib/material-shadows"

Stylus:

  @import "lib/material-shadows";

If you use Bower, the path would be:

  bower_components/material-shadows/..

The build variable:

(. | @include | none)(prefix)-z-depth-(depth)-(orientation)

  • (. | @include | none) - Sign of the variable in the preprocessor.
  • (prefix) - The prefix variable. Namespace of your variables and variables of the library. (With material-shadows-prefixed and without material-shadows)
  • (depth) - Depth 1..5.
  • (orientation) - None, Top or Bottom.

Simple example (Less):

  @import "lib/material-color";

  .example-1 {
    .z-depth();
    .z-depth-animation(3);
  }

  .example-2 {
    .z-depth-top(1);
    .z-depth-animation(5, top);
  }

HTML for .z-depth-animation():

  <div class="z-depth-animation">
    <div class="z-depth-2">.z-depth-2</div>
  </div>

Class generator example (less):

Options for animation:

  • @animation: [true (default) | false];
  • @time: .28s;
  • @function: cubic-bezier(.4, 0, .2, 1);
  @import "lib/material-color";
  
  // Class mixin
  .z-depth {
    .z-depth-class();
  }
  
  // => (output)
  .z-depth-1 {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.12);
  }
  .z-depth-1-top {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  }
  .z-depth-1-bottom {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
  }
  // and more

More examples in the test directory.

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.