feat(projects): support set global redius

This commit is contained in:
CyberShen123
2025-10-03 07:55:06 +08:00
parent 3b0ace3868
commit 21efca5194
7 changed files with 9 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ type ThemePreset = Pick<
| 'colourWeakness' | 'colourWeakness'
| 'recommendColor' | 'recommendColor'
| 'themeColor' | 'themeColor'
| 'themeRadius'
| 'otherColor' | 'otherColor'
| 'isInfoFollowPrimary' | 'isInfoFollowPrimary'
| 'layout' | 'layout'

View File

@@ -236,8 +236,9 @@ function getNaiveThemeColors(colors: App.Theme.ThemeColor, recommended = false)
/** /**
* Get naive theme * Get naive theme
* *
* @param colors Theme colors * @param settings Theme settings object.
* @param [recommended=false] Use recommended color. Default is `false` * @param settings.recommendColor Whether to use recommended color palette.
* @param settings.themeRadius Border radius to use in the theme (in px).
*/ */
export function getNaiveTheme(colors: App.Theme.ThemeColor, settings: App.Theme.ThemeSetting) { export function getNaiveTheme(colors: App.Theme.ThemeColor, settings: App.Theme.ThemeSetting) {
const { primary: colorLoading } = colors; const { primary: colorLoading } = colors;

View File

@@ -14,6 +14,7 @@
"warning": "#d4bb9d", "warning": "#d4bb9d",
"error": "#c49a9a" "error": "#c49a9a"
}, },
"themeRadius": 8,
"isInfoFollowPrimary": true, "isInfoFollowPrimary": true,
"layout": { "layout": {
"mode": "vertical-mix", "mode": "vertical-mix",

View File

@@ -14,6 +14,7 @@
"warning": "#faad14", "warning": "#faad14",
"error": "#f5222d" "error": "#f5222d"
}, },
"themeRadius": 8,
"isInfoFollowPrimary": true, "isInfoFollowPrimary": true,
"layout": { "layout": {
"mode": "vertical", "mode": "vertical",

View File

@@ -14,6 +14,7 @@
"warning": "#faad14", "warning": "#faad14",
"error": "#f5222d" "error": "#f5222d"
}, },
"themeRadius": 8,
"isInfoFollowPrimary": true, "isInfoFollowPrimary": true,
"layout": { "layout": {
"mode": "vertical", "mode": "vertical",

View File

@@ -14,6 +14,7 @@
"warning": "#faad14", "warning": "#faad14",
"error": "#f5222d" "error": "#f5222d"
}, },
"themeRadius": 8,
"isInfoFollowPrimary": true, "isInfoFollowPrimary": true,
"layout": { "layout": {
"mode": "vertical", "mode": "vertical",

View File

@@ -85,7 +85,7 @@ function getGradientColor(color: CardData['color']) {
<!-- define component start: GradientBg --> <!-- define component start: GradientBg -->
<DefineGradientBg v-slot="{ $slots, gradientColor }"> <DefineGradientBg v-slot="{ $slots, gradientColor }">
<div <div
class="rd-8px px-16px pb-4px pt-8px text-white" class="px-16px pb-4px pt-8px text-white"
:style="{ backgroundImage: gradientColor, borderRadius: themeStore.themeRadius + 'px' }" :style="{ backgroundImage: gradientColor, borderRadius: themeStore.themeRadius + 'px' }"
> >
<component :is="$slots.default" /> <component :is="$slots.default" />