46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
/*
|
|
* This file is part of the kernelstudio package.
|
|
*
|
|
* (c) 2014-2025 zlin <admin@kernelstudio.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE file
|
|
* that was distributed with this source code.
|
|
*/
|
|
|
|
import colors from 'tailwindcss/colors'
|
|
import plugin from 'tailwindcss/plugin'
|
|
import selectorParser from 'postcss-selector-parser'
|
|
|
|
/** @type {import('tailwindcss').Config} */
|
|
export default {
|
|
darkMode: 'class',
|
|
content: [
|
|
"./**/*.{vue,js,ts,jsx,tsx}",
|
|
],
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
...colors,
|
|
primary: {
|
|
light: '#e744ba',
|
|
dark: '#000'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
plugin(function ({addVariant, prefix}: any) {
|
|
addVariant('dark', ({modifySelectors, separator}: any) => {
|
|
modifySelectors(({selector}: any) => {
|
|
return selectorParser((selectors) => {
|
|
selectors.walkClasses((sel) => {
|
|
sel.value = `dark${separator}${sel.value}`
|
|
sel.parent?.insertBefore(sel, selectorParser().astSync(prefix('.dark-mode ')))
|
|
})
|
|
}).processSync(selector)
|
|
})
|
|
})
|
|
})
|
|
],
|
|
}
|