mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
9 months ago
|
import {readFileSync} from 'node:fs';
|
||
|
import {env} from 'node:process';
|
||
|
import {parse} from 'css-variables-parser';
|
||
|
|
||
|
const isProduction = env.NODE_ENV !== 'development';
|
||
|
|
||
|
export default {
|
||
|
prefix: 'tw-',
|
||
|
content: [
|
||
|
isProduction && '!./templates/devtest/**/*',
|
||
|
isProduction && '!./web_src/js/standalone/devtest.js',
|
||
|
'./templates/**/*.tmpl',
|
||
|
'./web_src/**/*.{js,vue}',
|
||
|
].filter(Boolean),
|
||
|
blocklist: [
|
||
|
// classes that don't work without CSS variables from "@tailwind base" which we don't use
|
||
|
'transform', 'shadow', 'ring', 'blur', 'grayscale', 'invert', '!invert', 'filter', '!filter',
|
||
|
'backdrop-filter',
|
||
|
// unneeded classes
|
||
|
'[-a-zA-Z:0-9_.]',
|
||
|
],
|
||
|
theme: {
|
||
|
colors: {
|
||
|
// make `tw-bg-red` etc work with our CSS variables
|
||
|
...Object.fromEntries(
|
||
|
Object.keys(parse([
|
||
|
readFileSync(new URL('web_src/css/themes/theme-gitea-light.css', import.meta.url), 'utf8'),
|
||
|
readFileSync(new URL('web_src/css/themes/theme-gitea-dark.css', import.meta.url), 'utf8'),
|
||
|
].join('\n'), {})).filter((prop) => prop.startsWith('color-')).map((prop) => {
|
||
|
const color = prop.substring(6);
|
||
|
return [color, `var(--color-${color})`];
|
||
|
})
|
||
|
),
|
||
|
inherit: 'inherit',
|
||
|
current: 'currentcolor',
|
||
|
transparent: 'transparent',
|
||
|
},
|
||
|
},
|
||
|
};
|