Skip to content

Latest commit

 

History

History
39 lines (19 loc) · 573 Bytes

README.md

File metadata and controls

39 lines (19 loc) · 573 Bytes

tailwind-create-theme

定义一个Tailwind 主题

Usage

step first

npm install -D tailwind-create-theme

step second

//tailwind.config.js

const { createTheme } = require('tailwind-create-theme')

const plugin = require('tailwindcss/plugin')

module.exports={

mode:'jit',

plugins:[plugin(createTheme ('dark'))]

}

Then

接下来你就可以在CSS中使用dark:w-4这样的tailwind语法了;

如果需要切换主题,那么你只需要:

onClick(()=>{

document.body.setAttribute('class','dark')

})