mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
build(theme): generate css file
This commit is contained in:
@@ -8,6 +8,9 @@
|
|||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"main": "dist/index.umd.cjs",
|
"main": "dist/index.umd.cjs",
|
||||||
@@ -17,10 +20,12 @@
|
|||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/index.js",
|
"import": "./dist/index.js",
|
||||||
"require": "./dist/index.umd.cjs"
|
"require": "./dist/index.umd.cjs"
|
||||||
}
|
},
|
||||||
|
"./style.css": "./dist/style.css"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@vanilla-extract/vite-plugin": "^3.8.0",
|
||||||
"vite": "^4.3.4",
|
"vite": "^4.3.4",
|
||||||
"vite-plugin-dts": "^2.3.0"
|
"vite-plugin-dts": "^2.3.0"
|
||||||
}
|
}
|
||||||
|
|||||||
11
packages/theme/src/index.css.ts
Normal file
11
packages/theme/src/index.css.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { globalStyle } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
import { darkCssVariables, lightCssVariables } from './index';
|
||||||
|
|
||||||
|
globalStyle(':root', {
|
||||||
|
vars: lightCssVariables,
|
||||||
|
});
|
||||||
|
|
||||||
|
globalStyle(':root[data-theme="dark"]', {
|
||||||
|
vars: darkCssVariables,
|
||||||
|
});
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import dts from 'vite-plugin-dts';
|
import dts from 'vite-plugin-dts';
|
||||||
@@ -13,13 +14,12 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
lib: {
|
lib: {
|
||||||
entry: resolve(__dirname, 'src/index.ts'),
|
entry: {
|
||||||
fileName: 'index',
|
index: resolve(__dirname, 'src/index.ts'),
|
||||||
|
css: resolve(__dirname, 'src/index.css.ts'),
|
||||||
|
},
|
||||||
name: 'ToEverythingTheme',
|
name: 'ToEverythingTheme',
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
|
||||||
external: ['idb', 'yjs'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
plugins: [dts()],
|
plugins: [dts(), vanillaExtractPlugin()],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8004,6 +8004,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@toeverything/theme@workspace:packages/theme"
|
resolution: "@toeverything/theme@workspace:packages/theme"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@vanilla-extract/vite-plugin": ^3.8.0
|
||||||
vite: ^4.3.4
|
vite: ^4.3.4
|
||||||
vite-plugin-dts: ^2.3.0
|
vite-plugin-dts: ^2.3.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
|
|||||||
Reference in New Issue
Block a user