Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@nextcss/material-colors
Advanced tools
Material Colors Module is part of Next.css framework. This module contains original Material Color Palette CSS styles for your Next.css project. You can use in all modern websites with module bundlers, like webpack, rollup, parcel.
You can install with npm or yarn package managers.
npm i @nextcss/material-colors
yarn add @nextcss/material-colors
Simple import to your project, and add class rules to you HTML tags. Check available selector rules below.
import '@nextcss/material-colors';
<!-- Set background color -->
<h1 class="bg-blue-500">...</h1>
<!-- Set background, border and text colors -->
<div class="bg-pink-50 b-pink-100 fg-pink-700">...</div>
<!-- Set text color, background and hover state background -->
<button class="fg-white bg-blue-500 hover:bg-blue-700">...</button>
Selector formula
[state:]prefix-color[-scale]
After state must use colon, state is not required.
hover
,active
,focus
,focus-in
After prefix must use hyphen, state is required.
fg
- foreground, bg
- background, b
- border
After color must be set scale value. color is required.
red
, pink
, purple
, deep-purple
, indigo
, blue
, light-blue
,cyan
,teal
,green
,light-green
,lime
,yellow
,amber
,orange
,deep-orange
,brown
,grey
,blues-grey
After color can not set scale value. color is required.
black
,white
Before scale must use hyphen, scale is required for scalable color only.
100
,200
,300
,400
,500
,600
,700
,800
,900
We strongly recommend to use postcss
with autoprefixer
and postcss-purgecss
. This stack will extend the CSS rules with browser specific prefixes, like -webkit
and will remove unused styles in production build.
npm i -D postcss autoprefixer @fullhuman/postcss-purgecss
Our postcss.config.js
config. You need to configure the content
parameter for your project.
module.exports = {
plugins:
process.env.NODE_ENV === 'production'
? [
'autoprefixer',
[
'@fullhuman/postcss-purgecss',
{
content: ['./{pages,components}/**/*.{js,jsx}'],
safelist: ['html', 'body'],
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
},
],
]
: ['autoprefixer'],
};
MIT License. Copyright (c) 2021 Zsolt Tovis
FAQs
material-colors module for Next.css.
We found that @nextcss/material-colors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.