style(@vben-core/layout-ui): 调整布局样式

- 调整布局内容区域样式
- 调整标签栏背景色以匹配侧边栏和顶部栏
- 优化布局整体视觉效果
This commit is contained in:
lzh
2025-12-22 14:56:42 +08:00
parent 855cb7154f
commit 43c6273d56
4 changed files with 44 additions and 6 deletions

View File

@@ -55,10 +55,21 @@ const style = computed((): CSSProperties => {
</script>
<template>
<main ref="contentElement" :style="style" class="relative bg-background-deep">
<main
ref="contentElement"
:style="style"
class="vben-layout-content relative bg-transparent"
>
<Slot :style="overlayStyle">
<slot name="overlay"></slot>
</Slot>
<slot></slot>
</main>
</template>
<style>
/* 深色主题下使用不透明背景 */
.dark .vben-layout-content {
background: hsl(var(--background-deep)) !important;
}
</style>

View File

@@ -23,7 +23,7 @@ const style = computed((): CSSProperties => {
<template>
<section
:style="style"
class="flex w-full border-b border-border bg-background transition-all"
class="flex w-full border-b border-border bg-tabbar transition-all"
>
<slot></slot>
</section>

View File

@@ -482,6 +482,18 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
<template>
<div class="relative flex min-h-full w-full">
<!-- 橙色渐变光晕背景 - 仅浅色主题fixed 定位 -->
<div class="vben-layout-gradient pointer-events-none fixed inset-0">
<!-- 左上角橙色光晕 -->
<div
class="bg-orange-300 absolute -left-[10%] -top-[20%] size-[500px] rounded-full opacity-10 blur-[120px]"
></div>
<!-- 右下角黄色光晕 -->
<div
class="bg-yellow-200 absolute -bottom-[10%] -right-[5%] size-[600px] rounded-full opacity-30 blur-[100px]"
></div>
</div>
<LayoutSidebar
v-if="sidebarEnableState"
v-model:collapse="sidebarCollapse"
@@ -615,3 +627,16 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
></div>
</div>
</template>
<style>
/* 橙色渐变光晕背景 - 只在浅色主题下显示 */
.vben-layout-gradient {
display: block;
z-index: 0;
}
/* 深色主题下隐藏 */
.dark .vben-layout-gradient {
display: none !important;
}
</style>

View File

@@ -374,6 +374,7 @@ $namespace: vben;
@mixin menu-item-active {
color: var(--menu-item-active-color);
font-weight: 600; /* 选中时字体加粗 */
text-decoration: none;
cursor: pointer;
background: var(--menu-item-active-background-color);
@@ -481,13 +482,13 @@ $namespace: vben;
// --menu-submenu-opened-background-color: hsl(var(--menu-opened));
--menu-item-background-color: var(--menu-background-color);
--menu-item-color: hsl(var(--foreground));
--menu-item-hover-color: var(--menu-item-color);
--menu-item-hover-color: #e06c00; /* 悬浮时橙色 */
--menu-item-hover-background-color: hsl(var(--accent));
--menu-item-active-color: hsl(var(--primary));
--menu-item-active-color: #b34e00; /* 选中时深橙色 */
--menu-item-active-background-color: hsl(var(--primary) / 15%);
--menu-submenu-hover-color: hsl(var(--primary));
--menu-submenu-hover-color: #e06c00; /* 子菜单悬浮时橙色 */
--menu-submenu-hover-background-color: hsl(var(--accent));
--menu-submenu-active-color: hsl(var(--primary));
--menu-submenu-active-color: #b34e00; /* 子菜单选中时深橙色 */
--menu-submenu-active-background-color: transparent;
--menu-submenu-background-color: var(--menu-background-color);
}
@@ -769,6 +770,7 @@ $namespace: vben;
&:not(.is-active):hover {
color: var(--menu-item-hover-color);
font-weight: 600; /* 悬浮时字体加粗 */
text-decoration: none;
cursor: pointer;
background: var(--menu-item-hover-background-color) !important;