1.0.1 • Published 1 year ago

vite-plugin-windicss-theme v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vite-plugin-windicss-theme

npm Code style: Prettier Donate

Access your WindiCSS theme and colors objects from a vite app.

 

Usage

tsconfig.json

{
    "include": ["src", "windi.config.ts", "vite.config.ts"]
}

vite.config.ts

import windiCSS from 'vite-plugin-windicss'
import windiThemePlugin from 'vite-plugin-windicss-theme'
import windiTheme from './windi.config'

export default {
  plugins: [
    windiCSS(), 
    windiThemePlugin({config: "./windi.config.ts"})
  ]
};
 

component.tsx

import {colors,theme} from 'virtual:windi-theme';
export const Root  = () => (
  <div>
    {JSON.stringify(colors,null,2)}
    <br/><br/><br/><br/>
    {JSON.stringify(theme,null,2)}
  </div>
);