Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
org.webjars.npm:sass-material-colors
Advanced tools
An easy way to use Google's Material Design color palette on your Sass project.
Sass Material Colors can be included as a Ruby Gem, a Bower component, or a Node Packaged Module (npm).
Add this line to your application's Gemfile:
$ gem 'sass-material-colors'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sass-material-colors
Install sass-material-colors
as a development dependency:
$ bower install --save-dev sass-material-colors
Install sass-material-colors
as a development dependency:
$ npm install --save-dev sass-material-colors
Import the colors map + function to your project:
// Sass
@import 'sass-material-colors'
If you're using Bower or npm, you may need to use the relative path to the main file, e.g.:
// Sass
// Bower
@import 'bower_components/sass-material-colors/sass/sass-material-colors'
// npm
@import 'node_modules/sass-material-colors/sass/sass-material-colors'
By importing this file, a $material-colors
Sass map will be added to your Sass project, with all the colors from Google's palette, as well as a material-color
function, making it easy for you to reference any color in the spec from your stylesheets.
Optionally, you can import a list of placeholder selectors and/or classes.
material-color
FunctionThe material-color
function allows you to easily reference any color in the _sass-material-colors-map.scss
file in your styles:
// Sass
.my-cool-element
color: material-color('cyan', '400')
background: material-color('blue-grey', '600')
The material-color
function takes 2 parameters:
$color-name
String (quoted), RequiredLower-case, dasherized color name from Google's palette (e.g.
'pink'
,'amber'
,'blue-grey'
,'deep-orange'
, etc.)
$color-variant
String (quoted), Optional [Default value: 500
]Lower-case color variant number/code from Google's palette (e.g.
'300'
,'200'
,'a100'
,'a400'
, etc.)
It's important for these parameters to be quoted strings, in order to maintain compatibility with Libsass.
You can include a list of extendable Sass placeholder selectors in your project by importing the sass-material-colors-placeholders
file into your Sass/Scss:
// Sass
@import 'sass-material-colors-placeholders'
This will add a %color-...
and %bg-color-...
placeholder selector for each color name and variant found in Google's palette to your project, which you can then extend in your stylesheets like so:
// Sass
.my-cool-element
@extend %color-cyan-400
@extend %bg-color-blue-grey-600
You can include a list of predefined classes in your project by importing the sass-material-colors-classes
file into your Sass/Scss:
// Sass
@import 'sass-material-colors-classes'
This will add a .color-...
and .bg-color-...
class for each color name and variant found in Google's palette to your stylesheets, which you can then use directly in your markup like so:
<!-- HTML -->
<div class='my-cool-element color-cyan-400 bg-color-blue-grey-600'></div>
-placeholders
and -classes
filesSee CONTRIBUTING.
See LICENSE.
To nilskaspersson/Google-Material-UI-Color-Palette for the inspiration on using a Sass map for the colors, and a map function to retrieve them.
To twbs/bootstrap-sass as a reference for this gem.
And to Google for their Material Design spec.
FAQs
WebJar for sass-material-colors
We found that org.webjars.npm:sass-material-colors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.