项目作者: mat-color

项目描述 :
This sass library helps you generate a material palette for use in @angular/material with one base color!
高级语言: SCSS
项目地址: git://github.com/mat-color/mat-color.git
创建时间: 2020-09-14T06:37:35Z
项目社区:https://github.com/mat-color/mat-color

开源协议:MIT License

下载



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:

  1. $primary: mat-palette(
  2. (
  3. 50: #fffee6,
  4. 100: #fefbbf,
  5. 200: #fcf893,
  6. 300: #faf464,
  7. 400: #f6ef39,
  8. 500: #fff500,
  9. 600: #ffe100,
  10. 700: #ffc800,
  11. 800: #ffae00,
  12. 900: #ff8100,
  13. contrast: (
  14. 50: rgba(0, 0, 0, 0.87),
  15. 100: rgba(0, 0, 0, 0.87),
  16. 200: rgba(0, 0, 0, 0.87),
  17. 300: rgba(0, 0, 0, 0.87),
  18. 400: rgba(0, 0, 0, 0.87),
  19. 500: rgba(0, 0, 0, 0.87),
  20. 600: rgba(0, 0, 0, 0.87),
  21. 700: rgba(0, 0, 0, 0.87),
  22. 800: rgba(0, 0, 0, 0.87),
  23. 900: rgba(0, 0, 0, 0.87)
  24. )
  25. )
  26. );

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!
    ```sass
    @import “~@mat-color/sass/mat-color”;

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

Say thanks


Buy Me A Coffee