radi-color-css
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

radi-color-css

npm version npm downloads bundle JSDocs License

A simple package that contains all the Radix Colors in a single importable CSS file, tailwind config, and tailwind safelist

how to use

modify your tailwind.config.js as follows:

import { radixColors, tailwindSafelist } from 'radi-color-css'

export default {
  darkMode: 'class',
  content: ['./src/**/*.{ts,tsx}'],
  // Include the safelist if Tailwind's JIT compiler dosnt show all colors unless explicitly named. This will increase your app bundle size !!!
  safelist: [
    ...tailwindSafelist
  ],
  theme: {
    // OVERRIDE the base theme completely instead of extending it
    colors: {
      ...radixColors,
    },
    // EXTEND the base theme completely instead of extending it
    extend: {
      colors: {
        ...radixColors,
      }
    }
    // ...rest of your config
  }
}

modify your global.css as follows:

// import the CSS file that contains all colors
@import "radi-color-css/dist/colors.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

License

MIT License © Omar McAdam

Readme

Keywords

none

Package Sidebar

Install

npm i radi-color-css

Weekly Downloads

148

Version

1.0.5

License

MIT

Unpacked Size

142 kB

Total Files

6

Last publish

Collaborators

  • mcpizza