Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): component style && common theme #814

Merged
merged 14 commits into from
Sep 26, 2024
6 changes: 4 additions & 2 deletions packages/design-core/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { initMonitor } from '@opentiny/tiny-engine-common/js/monitor'
import { injectGlobalComponents, setGlobalMonacoEditorTheme, Modal, Notify } from '@opentiny/tiny-engine-common'
import { initHttp } from '@opentiny/tiny-engine-http'
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
import { tinyEngineThemeLight } from '@opentiny/tiny-engine-theme-base'
import { defaultThemeList } from '@opentiny/tiny-engine-theme-base'
import {
defineEntry,
mergeRegistry,
Expand Down Expand Up @@ -51,8 +51,10 @@ const defaultLifeCycles = {

initHttp({ env: import.meta.env })

const theme = newRegistry.config.theme || 'light'
// eslint-disable-next-line no-new
new TinyThemeTool(tinyEngineThemeLight, 'tinyEngineTheme') // 初始化主题
new TinyThemeTool(defaultThemeList[theme], defaultThemeList[theme]?.id)
document.documentElement?.setAttribute?.('data-theme', theme)

if (import.meta.env.VITE_ERROR_MONITOR === 'true' && import.meta.env.VITE_ERROR_MONITOR_URL) {
initMonitor(import.meta.env.VITE_ERROR_MONITOR_URL)
Expand Down
1 change: 1 addition & 0 deletions packages/theme/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"author": "OpenTiny Team",
"license": "MIT",
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {},
"devDependencies": {
"rimraf": "^3.0.2",
"vite": "^4.3.7"
Expand Down
301 changes: 0 additions & 301 deletions packages/theme/base/src/base.js

This file was deleted.

Loading