Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5590cc8f
authored
Jul 28, 2024
by
vben
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
chore: update theme
1 parent
376fd17a
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
120 additions
and
40 deletions
apps/web-antd/src/app.vue
apps/web-antd/src/views/demos/nested/menu-1.vue
apps/web-antd/src/views/demos/nested/menu-2-1.vue
apps/web-antd/src/views/demos/nested/menu-3-1.vue
apps/web-antd/src/views/demos/nested/menu-3-2-1.vue
internal/tailwind-config/src/index.ts
packages/@core/shared/design/src/design-tokens/default/index.css
packages/effects/hooks/src/index.ts
packages/effects/hooks/src/use-design-tokens.ts
packages/effects/layouts/src/widgets/preferences/blocks/theme/builtin.vue
pnpm-lock.yaml
website/.vitepress/config.mts
website/package.json
website/src/guide/in-depth/theme.md
website/src/guide/introduction/quick-start.md
apps/web-antd/src/app.vue
View file @
5590cc8
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
computed
}
from
'vue'
;
import
{
computed
}
from
'vue'
;
import
{
GlobalProvider
}
from
'@vben/common-ui'
;
import
{
GlobalProvider
}
from
'@vben/common-ui'
;
import
{
useDesignTokens
}
from
'@vben/hooks'
;
import
{
preferences
,
usePreferences
}
from
'@vben/preferences'
;
import
{
preferences
,
usePreferences
}
from
'@vben/preferences'
;
import
{
App
,
ConfigProvider
,
theme
}
from
'ant-design-vue'
;
import
{
App
,
ConfigProvider
,
theme
}
from
'ant-design-vue'
;
...
@@ -11,6 +12,7 @@ import { antdLocale } from '#/locales';
...
@@ -11,6 +12,7 @@ import { antdLocale } from '#/locales';
defineOptions
({
name
:
'App'
});
defineOptions
({
name
:
'App'
});
const
{
isDark
}
=
usePreferences
();
const
{
isDark
}
=
usePreferences
();
const
{
antDesignTokens
}
=
useDesignTokens
();
const
tokenTheme
=
computed
(()
=>
{
const
tokenTheme
=
computed
(()
=>
{
const
algorithm
=
isDark
.
value
const
algorithm
=
isDark
.
value
...
@@ -24,7 +26,7 @@ const tokenTheme = computed(() => {
...
@@ -24,7 +26,7 @@ const tokenTheme = computed(() => {
return
{
return
{
algorithm
,
algorithm
,
token
:
{
colorPrimary
:
preferences
.
theme
.
colorPrimary
}
,
token
:
antDesignTokens
.
value
,
};
};
});
});
</
script
>
</
script
>
...
...
apps/web-antd/src/views/demos/nested/menu-1.vue
View file @
5590cc8
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<Fallback
status=
"coming-soon"
/>
<Fallback
status=
"coming-soon"
/>
<input
/>
</div>
</
template
>
</
template
>
apps/web-antd/src/views/demos/nested/menu-2-1.vue
View file @
5590cc8
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<Fallback
status=
"coming-soon"
/>
<Fallback
status=
"coming-soon"
/>
<input
/>
</div>
</
template
>
</
template
>
apps/web-antd/src/views/demos/nested/menu-3-1.vue
View file @
5590cc8
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<Fallback
status=
"coming-soon"
/>
<Fallback
status=
"coming-soon"
/>
<input
/>
</div>
</
template
>
</
template
>
apps/web-antd/src/views/demos/nested/menu-3-2-1.vue
View file @
5590cc8
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
...
@@ -3,8 +3,5 @@ import { Fallback } from '@vben/common-ui';
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<Fallback
status=
"coming-soon"
/>
<Fallback
status=
"coming-soon"
/>
<input
/>
</div>
</
template
>
</
template
>
internal/tailwind-config/src/index.ts
View file @
5590cc8
...
@@ -160,7 +160,7 @@ export default {
...
@@ -160,7 +160,7 @@ export default {
},
},
fontFamily
:
{
fontFamily
:
{
sans
:
[
sans
:
[
'var(--font-
geist-sans
)'
,
'var(--font-
family
)'
,
// ...defaultTheme.fontFamily.sans
// ...defaultTheme.fontFamily.sans
],
],
},
},
...
...
packages/@core/shared/design/src/design-tokens/default/index.css
View file @
5590cc8
:root
{
:root
{
--font-geist-sans
:
'pingfang sc'
,
-apple-system
,
blinkmacsystemfont
,
--font-family
:
-apple-system
,
blinkmacsystemfont
,
'Segoe UI'
,
roboto
,
'segoe ui'
,
helvetica
,
'helvetica neue'
,
'microsoft yahei ui'
,
'Helvetica Neue'
,
arial
,
'Noto Sans'
,
sans-serif
,
'Apple Color Emoji'
,
'microsoft yahei'
,
arial
,
'hiragino sans'
,
'apple color emoji'
,
'Segoe UI Emoji'
,
'Segoe UI Symbol'
,
'Noto Color Emoji'
;
'segoe ui emoji'
,
'segoe ui symbol'
,
simsun
,
sans-serif
;
/* Default background color of <body />...etc */
/* Default background color of <body />...etc */
--background
:
0
0%
100%
;
--background
:
0
0%
100%
;
...
...
packages/effects/hooks/src/index.ts
View file @
5590cc8
export
*
from
'./unmount-global-loading'
;
export
*
from
'./unmount-global-loading'
;
export
*
from
'./use-app-config'
;
export
*
from
'./use-app-config'
;
export
*
from
'./use-content-maximize'
;
export
*
from
'./use-content-maximize'
;
export
*
from
'./use-design-tokens'
;
export
*
from
'./use-refresh'
;
export
*
from
'./use-refresh'
;
export
*
from
'./use-tabs'
;
export
*
from
'./use-tabs'
;
export
*
from
'./use-watermark'
;
export
*
from
'./use-watermark'
;
...
...
packages/effects/hooks/src/use-design-tokens.ts
0 → 100644
View file @
5590cc8
import
{
computed
,
ref
,
watch
}
from
'vue'
;
import
{
preferences
}
from
'@vben/preferences'
;
export
function
useDesignTokens
()
{
const
rootStyles
=
getComputedStyle
(
document
.
documentElement
);
const
colorPrimary
=
ref
(
''
);
const
colorError
=
ref
(
''
);
const
colorSuccess
=
ref
(
''
);
const
colorWarning
=
ref
(
''
);
const
colorInfo
=
ref
(
''
);
const
colorBgBase
=
ref
(
''
);
const
colorTextBase
=
ref
(
''
);
const
colorBgContainer
=
ref
(
''
);
const
colorBgElevated
=
ref
(
''
);
const
colorBgLayout
=
ref
(
''
);
const
colorBgMask
=
ref
(
''
);
const
colorBorder
=
ref
(
''
);
const
borderRadius
=
ref
<
any
>
(
''
);
const
getCssVariableValue
=
(
variable
:
string
,
isColor
:
boolean
=
true
)
=>
{
const
value
=
rootStyles
.
getPropertyValue
(
variable
);
return
isColor
?
`hsl(
${
value
}
)`
:
value
;
};
watch
(
()
=>
preferences
.
theme
,
()
=>
{
colorInfo
.
value
=
colorPrimary
.
value
=
getCssVariableValue
(
'--primary'
);
colorError
.
value
=
getCssVariableValue
(
'--destructive'
);
colorWarning
.
value
=
getCssVariableValue
(
'--warning'
);
colorSuccess
.
value
=
getCssVariableValue
(
'--success'
);
colorBgBase
.
value
=
getCssVariableValue
(
'--background'
);
colorBgLayout
.
value
=
getCssVariableValue
(
'--background-deep'
);
colorBgMask
.
value
=
getCssVariableValue
(
'--overlay'
);
colorBorder
.
value
=
getCssVariableValue
(
'--border'
);
colorTextBase
.
value
=
getCssVariableValue
(
'--foreground'
);
colorBgElevated
.
value
=
getCssVariableValue
(
'--popover'
);
colorBgContainer
.
value
=
getCssVariableValue
(
'--card'
);
borderRadius
.
value
=
getCssVariableValue
(
'--radius'
,
false
);
},
{
immediate
:
true
},
);
const
antDesignTokens
=
computed
(()
=>
{
return
{
borderRadius
:
borderRadius
.
value
,
colorBgBase
:
colorBgBase
.
value
,
colorBgContainer
:
colorBgContainer
.
value
,
colorBgElevated
:
colorBgElevated
.
value
,
colorBgLayout
:
colorBgLayout
.
value
,
colorBgMask
:
colorBgMask
.
value
,
colorBorder
:
colorBorder
.
value
,
colorError
:
colorError
.
value
,
colorInfo
:
colorInfo
.
value
,
colorPrimary
:
colorPrimary
.
value
,
colorSuccess
:
colorSuccess
.
value
,
colorTextBase
:
colorTextBase
.
value
,
colorWarning
:
colorWarning
.
value
,
};
});
return
{
antDesignTokens
,
borderRadius
,
colorBgBase
,
colorBgContainer
,
colorBgElevated
,
colorBorder
,
colorError
,
colorInfo
,
colorPrimary
,
colorSuccess
,
colorTextBase
,
colorWarning
,
};
}
packages/effects/layouts/src/widgets/preferences/blocks/theme/builtin.vue
View file @
5590cc8
...
@@ -8,7 +8,6 @@ import { $t } from '@vben/locales';
...
@@ -8,7 +8,6 @@ import { $t } from '@vben/locales';
import
{
import
{
BUILT_IN_THEME_PRESETS
,
BUILT_IN_THEME_PRESETS
,
type
BuiltinThemePreset
,
type
BuiltinThemePreset
,
preferences
,
}
from
'@vben/preferences'
;
}
from
'@vben/preferences'
;
import
{
convertToHsl
,
TinyColor
}
from
'@vben/utils'
;
import
{
convertToHsl
,
TinyColor
}
from
'@vben/utils'
;
...
@@ -29,9 +28,13 @@ const inputValue = computed(() => {
...
@@ -29,9 +28,13 @@ const inputValue = computed(() => {
const
builtinThemePresets
=
computed
(()
=>
{
const
builtinThemePresets
=
computed
(()
=>
{
return
[
return
[
{
{
color
:
preferences
.
theme
.
colorPrimary
,
color
:
'hsl(231 98% 65%)'
,
type
:
'default'
,
type
:
'default'
,
},
},
// {
// color: 'hsl(231 98% 65%)',
// type: 'default',
// },
...
BUILT_IN_THEME_PRESETS
,
...
BUILT_IN_THEME_PRESETS
,
];
];
});
});
...
...
pnpm-lock.yaml
View file @
5590cc8
...
@@ -711,12 +711,6 @@ importers:
...
@@ -711,12 +711,6 @@ importers:
specifier
:
^3.4.34
specifier
:
^3.4.34
version
:
3.4.34(typescript@5.5.4)
version
:
3.4.34(typescript@5.5.4)
packages/effects/common-logic
:
dependencies
:
vue
:
specifier
:
^3.4.34
version
:
3.4.34(typescript@5.5.4)
packages/effects/common-ui
:
packages/effects/common-ui
:
dependencies
:
dependencies
:
'
@vben-core/shadcn-ui'
:
'
@vben-core/shadcn-ui'
:
...
@@ -768,6 +762,9 @@ importers:
...
@@ -768,6 +762,9 @@ importers:
'
@vben/types'
:
'
@vben/types'
:
specifier
:
workspace:*
specifier
:
workspace:*
version
:
link:../../types
version
:
link:../../types
'
@vueuse/core'
:
specifier
:
^10.11.0
version
:
10.11.0(vue@3.4.34(typescript@5.5.4))
vue
:
vue
:
specifier
:
^3.4.34
specifier
:
^3.4.34
version
:
3.4.34(typescript@5.5.4)
version
:
3.4.34(typescript@5.5.4)
...
@@ -3089,6 +3086,7 @@ packages:
...
@@ -3089,6 +3086,7 @@ packages:
'
@ls-lint/ls-lint@2.2.3'
:
'
@ls-lint/ls-lint@2.2.3'
:
resolution
:
{
integrity
:
sha512-ekM12jNm/7O2I/hsRv9HvYkRdfrHpiV1epVuI2NP+eTIcEgdIdKkKCs9KgQydu/8R5YXTov9aHdOgplmCHLupw==
}
resolution
:
{
integrity
:
sha512-ekM12jNm/7O2I/hsRv9HvYkRdfrHpiV1epVuI2NP+eTIcEgdIdKkKCs9KgQydu/8R5YXTov9aHdOgplmCHLupw==
}
cpu
:
[
x64
,
arm64
,
s390x
]
os
:
[
darwin
,
linux
,
win32
]
os
:
[
darwin
,
linux
,
win32
]
hasBin
:
true
hasBin
:
true
...
@@ -3725,7 +3723,7 @@ packages:
...
@@ -3725,7 +3723,7 @@ packages:
engines
:
{
node
:
^18.18.0 || >=20.0.0
}
engines
:
{
node
:
^18.18.0 || >=20.0.0
}
peerDependencies
:
peerDependencies
:
'
@typescript-eslint/parser'
:
^7.0.0
'
@typescript-eslint/parser'
:
^7.0.0
eslint
:
^8.5
6
.0
eslint
:
^8.5
7
.0
typescript
:
'
*'
typescript
:
'
*'
peerDependenciesMeta
:
peerDependenciesMeta
:
typescript
:
typescript
:
...
@@ -3772,7 +3770,7 @@ packages:
...
@@ -3772,7 +3770,7 @@ packages:
resolution
:
{
integrity
:
sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==
}
resolution
:
{
integrity
:
sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==
}
engines
:
{
node
:
^18.18.0 || >=20.0.0
}
engines
:
{
node
:
^18.18.0 || >=20.0.0
}
peerDependencies
:
peerDependencies
:
eslint
:
^
8.56
.0
eslint
:
^
9.7
.0
'
@typescript-eslint/visitor-keys@7.17.0'
:
'
@typescript-eslint/visitor-keys@7.17.0'
:
resolution
:
{
integrity
:
sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==
}
resolution
:
{
integrity
:
sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==
}
...
@@ -5248,7 +5246,7 @@ packages:
...
@@ -5248,7 +5246,7 @@ packages:
resolution
:
{
integrity
:
sha512-/UbPA+bYY7nIxcjL3kpcDY3UNdoLHFhyBFzHox2M0ypcUoueTn6woZUUmzzi5et/dXChksasYYFeKE2wshOrhg==
}
resolution
:
{
integrity
:
sha512-/UbPA+bYY7nIxcjL3kpcDY3UNdoLHFhyBFzHox2M0ypcUoueTn6woZUUmzzi5et/dXChksasYYFeKE2wshOrhg==
}
engines
:
{
node
:
'
>=16'
}
engines
:
{
node
:
'
>=16'
}
peerDependencies
:
peerDependencies
:
eslint
:
^
8.56.0 || ^9.0.0-
0
eslint
:
^
9.7.
0
eslint-plugin-jsdoc@48.8.3
:
eslint-plugin-jsdoc@48.8.3
:
resolution
:
{
integrity
:
sha512-AtIvwwW9D17MRkM0Z0y3/xZYaa9mdAvJrkY6fU/HNUwGbmMtHVvK4qRM9CDixGVtfNrQitb8c6zQtdh6cTOvLg==
}
resolution
:
{
integrity
:
sha512-AtIvwwW9D17MRkM0Z0y3/xZYaa9mdAvJrkY6fU/HNUwGbmMtHVvK4qRM9CDixGVtfNrQitb8c6zQtdh6cTOvLg==
}
...
@@ -5320,7 +5318,7 @@ packages:
...
@@ -5320,7 +5318,7 @@ packages:
resolution
:
{
integrity
:
sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==
}
resolution
:
{
integrity
:
sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==
}
engines
:
{
node
:
'
>=18.18'
}
engines
:
{
node
:
'
>=18.18'
}
peerDependencies
:
peerDependencies
:
eslint
:
'
>=8.56.0'
eslint
:
^8.57.0
eslint-plugin-unused-imports@4.0.1
:
eslint-plugin-unused-imports@4.0.1
:
resolution
:
{
integrity
:
sha512-rax76s05z64uQgG9YXsWFmXrgjkaK79AvfeAWiSxhPP6RVGxeRaj4+2u+wxxu/mDy2pmJoOy1QTOEALMia2xGQ==
}
resolution
:
{
integrity
:
sha512-rax76s05z64uQgG9YXsWFmXrgjkaK79AvfeAWiSxhPP6RVGxeRaj4+2u+wxxu/mDy2pmJoOy1QTOEALMia2xGQ==
}
...
...
website/.vitepress/config.mts
View file @
5590cc8
...
@@ -304,5 +304,18 @@ function head(): HeadConfig[] {
...
@@ -304,5 +304,18 @@ function head(): HeadConfig[] {
// src: 'https://cdn.tailwindcss.com',
// src: 'https://cdn.tailwindcss.com',
// },
// },
// ],
// ],
[
'script',
{},
`
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?2e443a834727c065877c01d89921545e";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`,
],
];
];
}
}
website/package.json
View file @
5590cc8
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"version"
:
"5.0.0"
,
"version"
:
"5.0.0"
,
"private"
:
true
,
"private"
:
true
,
"scripts"
:
{
"scripts"
:
{
"
docs:
build"
:
"vitepress build"
,
"build"
:
"vitepress build"
,
"docs:dev"
:
"vitepress dev"
,
"docs:dev"
:
"vitepress dev"
,
"docs:preview"
:
"vitepress preview"
"docs:preview"
:
"vitepress preview"
},
},
...
...
website/src/guide/in-depth/theme.md
View file @
5590cc8
...
@@ -28,10 +28,9 @@ css 变量内的颜色,必须使用 `hsl` 格式,如 `0 0% 100%`,不需要
...
@@ -28,10 +28,9 @@ css 变量内的颜色,必须使用 `hsl` 格式,如 `0 0% 100%`,不需要
```
css
```
css
:root
{
:root
{
--font-geist-sans
:
'pingfang sc'
,
-apple-system
,
blinkmacsystemfont
,
--font-family
:
-apple-system
,
blinkmacsystemfont
,
'Segoe UI'
,
roboto
,
'segoe ui'
,
helvetica
,
'helvetica neue'
,
'microsoft yahei ui'
,
'Helvetica Neue'
,
arial
,
'Noto Sans'
,
sans-serif
,
'Apple Color Emoji'
,
'microsoft yahei'
,
arial
,
'hiragino sans'
,
'apple color emoji'
,
'Segoe UI Emoji'
,
'Segoe UI Symbol'
,
'Noto Color Emoji'
;
'segoe ui emoji'
,
'segoe ui symbol'
,
simsun
,
sans-serif
;
/* Default background color of <body />...etc */
/* Default background color of <body />...etc */
--background
:
0
0%
100%
;
--background
:
0
0%
100%
;
...
@@ -331,10 +330,9 @@ type BuiltinThemeType =
...
@@ -331,10 +330,9 @@ type BuiltinThemeType =
```
css
```
css
:root
{
:root
{
--font-geist-sans
:
'pingfang sc'
,
-apple-system
,
blinkmacsystemfont
,
--font-family
:
-apple-system
,
blinkmacsystemfont
,
'Segoe UI'
,
roboto
,
'segoe ui'
,
helvetica
,
'helvetica neue'
,
'microsoft yahei ui'
,
'Helvetica Neue'
,
arial
,
'Noto Sans'
,
sans-serif
,
'Apple Color Emoji'
,
'microsoft yahei'
,
arial
,
'hiragino sans'
,
'apple color emoji'
,
'Segoe UI Emoji'
,
'Segoe UI Symbol'
,
'Noto Color Emoji'
;
'segoe ui emoji'
,
'segoe ui symbol'
,
simsun
,
sans-serif
;
/* Default background color of <body />...etc */
/* Default background color of <body />...etc */
--background
:
0
0%
100%
;
--background
:
0
0%
100%
;
...
...
website/src/guide/introduction/quick-start.md
View file @
5590cc8
...
@@ -81,4 +81,4 @@ pnpm dev
...
@@ -81,4 +81,4 @@ pnpm dev
```
```
现在,你可以在浏览器访问
[
http://localhost:5555
](
http://localhost:5555
)
查看项目。
现在,你可以在浏览器访问
`http://localhost:5555`
查看项目。
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment