Giter Site home page Giter Site logo

mat-color / mat-color Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 286 KB

This sass library helps you generate a material palette for use in @angular/material with one base color!

License: MIT License

TypeScript 20.40% JavaScript 5.55% HTML 1.80% SCSS 72.25%
sass math angular material-design material-colors material-palette mat-color angular-material

mat-color's Introduction

Logo

@mat-color/sass

Wherewith are you creating a material palette for an Angular Material project? Usual it doing with online tools or apps.

A custom material palette is a big sass map, and makes it manually is a tricky thing. It looks like this:

$primary: mat-palette(
    (
      50: #fffee6,
      100: #fefbbf,
      200: #fcf893,
      300: #faf464,
      400: #f6ef39,
      500: #fff500,
      600: #ffe100,
      700: #ffc800,
      800: #ffae00,
      900: #ff8100,
      contrast: (
        50: rgba(0, 0, 0, 0.87),
        100: rgba(0, 0, 0, 0.87),
        200: rgba(0, 0, 0, 0.87),
        300: rgba(0, 0, 0, 0.87),
        400: rgba(0, 0, 0, 0.87),
        500: rgba(0, 0, 0, 0.87),
        600: rgba(0, 0, 0, 0.87),
        700: rgba(0, 0, 0, 0.87),
        800: rgba(0, 0, 0, 0.87),
        900: rgba(0, 0, 0, 0.87)
      )
    )
);

But what if we could make a palette using one color in our code? It is possible because SASS can do the math!

This sass library helps you generate a material palette for use in @angular/material with one base color!

How it use

  1. Install package npm i @mat-color/sass
  2. Import @mat-color/sass/mat-color in your sass-file.
  3. Use the 'generate-mat-color' function.
  4. Call the 'mat-palette' function with the returned result.
  5. Enjoy!
@import "~@mat-color/sass/mat-color";

$primary: mat-palette(generate-mat-color(#b9ffaf));

Say thanks

Buy Me A Coffee

mat-color's People

Contributors

ikatsuba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

benoitpotty

mat-color's Issues

JS api

Is your feature request related to a problem? Please describe.
I want to use it in JavaScript.

Describe the solution you'd like
I want to implement the mat-color/core library (or with another name). This library can be used in JavaScript/TypeScript projects.

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.