Skip to content

Access your WindiCSS theme and color object from a vite app.

License

Notifications You must be signed in to change notification settings

AskAlice/vite-plugin-windicss-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>
);

About

Access your WindiCSS theme and color object from a vite app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published