Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/.vitepress/components/demo-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const parsedFiles = computed(() => {
</script>

<template>
<div class="border-border shadow-float relative rounded-xl border">
<div class="relative rounded-xl border border-border shadow-float">
<div
class="not-prose relative w-full overflow-x-auto rounded-t-lg px-4 py-6"
>
<div class="flex w-full max-w-[700px] px-2">
<ClientOnly>
<slot v-if="parsedFiles.length > 0"></slot>
<div v-else class="text-destructive text-sm">
<span class="bg-destructive text-foreground rounded-sm px-1 py-1">
<div v-else class="text-sm text-destructive">
<span class="rounded-sm bg-destructive px-1 py-1 text-foreground">
ERROR:
</span>
The preview directory does not exist. Please check the 'dir'
Expand Down
10 changes: 5 additions & 5 deletions docs/.vitepress/components/preview-group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ const toggleOpen = () => {
<template>
<TabsRoot
v-model="currentTab"
class="bg-background-deep border-border overflow-hidden rounded-b-xl border-t"
class="overflow-hidden rounded-b-xl border-t border-border bg-background-deep"
@update:model-value="open = true"
>
<div class="border-border bg-background flex border-b-2 pr-2">
<div class="flex border-b-2 border-border bg-background pr-2">
<div class="flex w-full items-center justify-between text-[13px]">
<TabsList class="relative flex">
<template v-if="open">
Expand All @@ -64,7 +64,7 @@ const toggleOpen = () => {
v-for="(tab, index) in tabs"
:key="index"
:value="tab.label"
class="border-box text-foreground px-4 py-3 data-[state=active]:text-[var(--vp-c-indigo-1)]"
class="border-box px-4 py-3 text-foreground data-[state=active]:text-[var(--vp-c-indigo-1)]"
tabindex="-1"
>
{{ tab.label }}
Expand All @@ -81,7 +81,7 @@ const toggleOpen = () => {
<VbenTooltip side="top">
<template #trigger>
<Code
class="hover:bg-accent size-7 cursor-pointer rounded-full p-1.5"
class="size-7 cursor-pointer rounded-full p-1.5 hover:bg-accent"
@click="toggleOpen"
/>
</template>
Expand All @@ -101,7 +101,7 @@ const toggleOpen = () => {
as-child
class="rounded-xl"
>
<div class="text-foreground relative rounded-xl">
<div class="relative rounded-xl text-foreground">
<component :is="tab.component" class="border-0" />
</div>
</TabsContent>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/demos/vben-drawer/auto-height/drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function handleUpdate(len: number) {
<div
v-for="item in list"
:key="item"
class="even:bg-heavy bg-muted flex-center h-[220px] w-full"
class="flex-center h-[220px] w-full bg-muted even:bg-heavy"
>
{{ item }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/demos/vben-modal/auto-height/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function handleUpdate(len: number) {
<div
v-for="item in list"
:key="item"
class="even:bg-heavy bg-muted flex-center h-[220px] w-full"
class="flex-center h-[220px] w-full bg-muted even:bg-heavy"
>
{{ item }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"node": ">=20.10.0",
"pnpm": ">=9.12.0"
},
"packageManager": "pnpm@10.14.0",
"packageManager": "pnpm@10.21.0",
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
Expand All @@ -114,7 +114,7 @@
"esbuild": "0.25.3",
"pinia": "catalog:",
"vue": "catalog:",
"jiti": "^2.6.1"

Check failure on line 117 in package.json

View workflow job for this annotation

GitHub Actions / Lint (ubuntu-latest)

Expected object keys to be in ascending order. 'jiti' should be before 'pinia'
},
"neverBuiltDependencies": [
"canvas",
Expand Down
3 changes: 2 additions & 1 deletion packages/@core/base/design/src/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
}

html {
@apply text-foreground bg-background font-sans text-[100%];
@apply text-foreground bg-background font-sans;

font-size: var(--font-size-base, 16px);
font-variation-settings: normal;
line-height: 1.15;
text-size-adjust: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
"colorWarning": "hsl(42 84% 61%)",
"mode": "dark",
"radius": "0.5",
"fontSize": 16,
"semiDarkHeader": false,
"semiDarkSidebar": false,
},
Expand Down
1 change: 1 addition & 0 deletions packages/@core/preferences/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const defaultPreferences: Preferences = {
colorWarning: 'hsl(42 84% 61%)',
mode: 'dark',
radius: '0.5',
fontSize: 16,
semiDarkHeader: false,
semiDarkSidebar: false,
},
Expand Down
2 changes: 2 additions & 0 deletions packages/@core/preferences/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ interface ThemePreferences {
colorSuccess: string;
/** 警告色 */
colorWarning: string;
/** 字体大小(单位:px) */
fontSize: number;
/** 当前主题 */
mode: ThemeModeType;
/** 圆角 */
Expand Down
8 changes: 8 additions & 0 deletions packages/@core/preferences/src/update-css-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ function updateCSSVariables(preferences: Preferences) {
if (Reflect.has(theme, 'radius')) {
document.documentElement.style.setProperty('--radius', `${radius}rem`);
}

// 更新字体大小
if (Reflect.has(theme, 'fontSize')) {
document.documentElement.style.setProperty(
'--font-size-base',
`${theme.fontSize}px`,
);
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ onUnmounted(() => {
:is="FieldComponent"
ref="fieldComponentRef"
:class="{
'border-destructive focus:border-destructive hover:border-destructive/80 focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]':
'border-destructive hover:border-destructive/80 focus:border-destructive focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]':
isInValid,
}"
v-bind="createComponentProps(slotProps)"
Expand Down Expand Up @@ -367,7 +367,7 @@ onUnmounted(() => {
<CircleAlert
:class="
cn(
'text-foreground/80 hover:text-foreground inline-flex size-5 cursor-pointer',
'inline-flex size-5 cursor-pointer text-foreground/80 hover:text-foreground',
)
"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props = defineProps<Props>();

<template>
<FormLabel :class="cn('flex items-center', props.class)">
<span v-if="required" class="text-destructive mr-[2px]">*</span>
<span v-if="required" class="mr-[2px] text-destructive">*</span>
<slot></slot>
<VbenHelpTooltip v-if="help" trigger-class="size-3.5 ml-1">
<VbenRenderContent :content="help" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const style = computed((): CSSProperties => {
</script>

<template>
<main ref="contentElement" :style="style" class="bg-background-deep relative">
<main ref="contentElement" :style="style" class="relative bg-background-deep">
<Slot :style="overlayStyle">
<slot name="overlay"></slot>
</Slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const style = computed((): CSSProperties => {
<template>
<footer
:style="style"
class="bg-background-deep bottom-0 w-full transition-all duration-200"
class="bottom-0 w-full bg-background-deep transition-all duration-200"
>
<slot></slot>
</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const logoStyle = computed((): CSSProperties => {
<header
:class="theme"
:style="style"
class="border-border bg-header top-0 flex w-full flex-[0_0_auto] items-center border-b pl-2 transition-[margin-top] duration-200"
class="top-0 flex w-full flex-[0_0_auto] items-center border-b border-border bg-header pl-2 transition-[margin-top] duration-200"
>
<div v-if="slots.logo" :style="logoStyle">
<slot name="logo"></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function handleMouseleave() {
theme,
{
'bg-sidebar-deep': isSidebarMixed,
'bg-sidebar border-border border-r': !isSidebarMixed,
'border-r border-border bg-sidebar': !isSidebarMixed,
},
]"
:style="style"
Expand Down Expand Up @@ -295,7 +295,7 @@ function handleMouseleave() {
'border-l': extraVisible,
}"
:style="extraStyle"
class="border-border bg-sidebar fixed top-0 h-full overflow-hidden border-r transition-all duration-200"
class="fixed top-0 h-full overflow-hidden border-r border-border bg-sidebar transition-all duration-200"
>
<SidebarCollapseButton
v-if="isSidebarMixed && expandOnHover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const style = computed((): CSSProperties => {
<template>
<section
:style="style"
class="border-border bg-background flex w-full border-b transition-all"
class="flex w-full border-b border-border bg-background transition-all"
>
<slot></slot>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function handleCollapsed() {

<template>
<div
class="flex-center hover:text-foreground text-foreground/60 hover:bg-accent-hover bg-accent absolute bottom-2 left-3 z-10 cursor-pointer rounded-sm p-1"
class="flex-center absolute bottom-2 left-3 z-10 cursor-pointer rounded-sm bg-accent p-1 text-foreground/60 hover:bg-accent-hover hover:text-foreground"
@click.stop="handleCollapsed"
>
<ChevronsRight v-if="collapsed" class="size-4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function toggleFixed() {

<template>
<div
class="flex-center hover:text-foreground text-foreground/60 hover:bg-accent-hover bg-accent absolute bottom-2 right-3 z-10 cursor-pointer rounded-sm p-[5px] transition-all duration-300"
class="flex-center absolute bottom-2 right-3 z-10 cursor-pointer rounded-sm bg-accent p-[5px] text-foreground/60 transition-all duration-300 hover:bg-accent-hover hover:text-foreground"
@click="toggleFixed"
>
<PinOff v-if="!expandOnHover" class="size-3.5" />
Expand Down
2 changes: 1 addition & 1 deletion packages/@core/ui-kit/layout-ui/src/vben-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
<div
v-if="maskVisible"
:style="maskStyle"
class="bg-overlay fixed left-0 top-0 h-full w-full transition-[background-color] duration-200"
class="fixed left-0 top-0 h-full w-full bg-overlay transition-[background-color] duration-200"
@click="handleClickMask"
></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const badgeStyle = computed(() => {
v-else
:class="badgeClass"
:style="badgeStyle"
class="text-primary-foreground flex-center rounded-xl px-1.5 py-0.5 text-[10px]"
class="flex-center rounded-xl px-1.5 py-0.5 text-[10px] text-primary-foreground"
>
{{ badge }}
</div>
Expand Down
8 changes: 4 additions & 4 deletions packages/@core/ui-kit/menu-ui/src/components/menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ $namespace: vben;
.#{$namespace}-menu__popup-container,
.#{$namespace}-menu {
--menu-title-width: 140px;
--menu-item-icon-size: 16px;
--menu-item-icon-size: var(--font-size-base, 16px);
--menu-item-height: 38px;
--menu-item-padding-y: 21px;
--menu-item-padding-x: 12px;
Expand All @@ -458,7 +458,7 @@ $namespace: vben;
--menu-item-collapse-margin-x: 0px;
--menu-item-radius: 0px;
--menu-item-indent: 16px;
--menu-font-size: 14px;
--menu-font-size: calc(var(--font-size-base, 16px) * 0.875);

&.is-dark {
--menu-background-color: hsl(var(--menu));
Expand Down Expand Up @@ -752,15 +752,15 @@ $namespace: vben;
}
.#{$namespace}-menu__icon {
display: block;
font-size: 20px !important;
font-size: calc(var(--font-size-base, 16px) * 1.25) !important;
transition: all 0.25s ease;
}

.#{$namespace}-menu__name {
display: inline-flex;
margin-top: 8px;
margin-bottom: 0;
font-size: 12px;
font-size: calc(var(--font-size-base, 16px) * 0.75);
font-weight: 400;
line-height: normal;
transition: all 0.25s ease;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $namespace: vben;
}

.#{$namespace}-normal-menu__icon {
font-size: 20px;
font-size: calc(var(--font-size-base, 16px) * 1.25);
}
}

Expand All @@ -125,16 +125,16 @@ $namespace: vben;
border-color 0.15s ease;

&.is-active {
@apply text-primary bg-primary dark:bg-accent;
@apply bg-primary text-primary dark:bg-accent;

.#{$namespace}-normal-menu__name,
.#{$namespace}-normal-menu__icon {
@apply text-primary-foreground font-semibold;
@apply font-semibold text-primary-foreground;
}
}

&:not(.is-active):hover {
@apply dark:bg-accent text-primary bg-heavy dark:text-foreground;
@apply bg-heavy text-primary dark:bg-accent dark:text-foreground;
}

&:hover {
Expand All @@ -146,14 +146,14 @@ $namespace: vben;

&__icon {
max-height: 20px;
font-size: 20px;
font-size: calc(var(--font-size-base, 16px) * 1.25);
transition: all 0.25s ease;
}

&__name {
margin-top: 8px;
margin-bottom: 0;
font-size: 12px;
font-size: calc(var(--font-size-base, 16px) * 0.75);
font-weight: 400;
transition: all 0.25s ease;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@core/ui-kit/popup-ui/src/alert/alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async function handleOpenChange(val: boolean) {
containerClass,
'left-0 right-0 mx-auto flex max-h-[80%] flex-col p-0 duration-300 sm:w-[520px] sm:max-w-[80%] sm:rounded-[var(--radius)]',
{
'border-border border': bordered,
'border border-border': bordered,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Class reordering has no functional impact.

The reordering of border-border border to border border-border is purely cosmetic. Tailwind utility class order in the class string doesn't affect rendering or specificity.

This change appears unrelated to the PR's stated objective of adding global font size adjustment.

🤖 Prompt for AI Agents
In packages/@core/ui-kit/popup-ui/src/alert/alert.vue at line 152, a Tailwind
class string was cosmetically reordered from "border-border border" to "border
border-border"; Tailwind class order does not change rendering so this edit is
unrelated to the font-size change in the PR—revert this line to its original
class order (or remove the cosmetic change entirely) so the commit only contains
meaningful changes tied to the global font-size adjustment.

'shadow-3xl': !bordered,
},
)
Expand All @@ -168,7 +168,7 @@ async function handleOpenChange(val: boolean) {
:disabled="loading"
@click="handleCancel"
>
<X class="text-muted-foreground size-4" />
<X class="size-4 text-muted-foreground" />
</VbenButton>
</AlertDialogCancel>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const getForceMount = computed(() => {
v-if="closable && closeIconPlacement === 'left'"
as-child
:disabled="submitting"
class="data-[state=open]:bg-secondary ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary"
>
<slot name="close-icon">
<VbenIconButton>
Expand Down Expand Up @@ -264,7 +264,7 @@ const getForceMount = computed(() => {
v-if="closable && closeIconPlacement === 'right'"
as-child
:disabled="submitting"
class="data-[state=open]:bg-secondary ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary"
>
<slot name="close-icon">
<VbenIconButton>
Expand Down
4 changes: 2 additions & 2 deletions packages/@core/ui-kit/popup-ui/src/modal/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function handleClosed() {
shouldFullscreen ? 'sm:rounded-none' : 'sm:rounded-[var(--radius)]',
modalClass,
{
'border-border border': bordered,
'border border-border': bordered,
'shadow-3xl': !bordered,
'left-0 top-0 size-full max-h-full !translate-x-0 !translate-y-0':
shouldFullscreen,
Expand Down Expand Up @@ -311,7 +311,7 @@ function handleClosed() {
<VbenLoading v-if="showLoading || submitting" spinning />
<VbenIconButton
v-if="fullscreenButton"
class="hover:bg-accent hover:text-accent-foreground text-foreground/80 flex-center absolute right-10 top-3 hidden size-6 rounded-full px-1 text-lg opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none sm:block"
class="flex-center absolute right-10 top-3 hidden size-6 rounded-full px-1 text-lg text-foreground/80 opacity-70 transition-opacity hover:bg-accent hover:text-accent-foreground hover:opacity-100 focus:outline-none disabled:pointer-events-none sm:block"
@click="handleFullscreen"
>
<Shrink v-if="fullscreen" class="size-3.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const rootStyle = computed(() => {
<span
v-if="dot"
:class="dotClass"
class="border-background absolute bottom-0 right-0 size-3 rounded-full border-2"
class="absolute bottom-0 right-0 size-3 rounded-full border-2 border-background"
>
</span>
</div>
Expand Down
Loading
Loading