diff --git a/src/assets/style/theme/register.scss b/src/assets/style/theme/register.scss index 4928b82d..92ef3828 100644 --- a/src/assets/style/theme/register.scss +++ b/src/assets/style/theme/register.scss @@ -1,3 +1,6 @@ +@import '~@/assets/style/public.scss'; +@import '~@/assets/style/theme/theme-base.scss'; + @import '~@/assets/style/theme/d2/index.scss'; @import '~@/assets/style/theme/line/index.scss'; @import '~@/assets/style/theme/star/index.scss'; diff --git a/src/assets/style/theme/theme-base.scss b/src/assets/style/theme/theme-base.scss new file mode 100644 index 00000000..6abee281 --- /dev/null +++ b/src/assets/style/theme/theme-base.scss @@ -0,0 +1,199 @@ +// 主题公用 +.layout-main-group { + &.grayMode { + -webkit-filter: grayscale(100%); + -moz-filter: grayscale(100%); + -ms-filter: grayscale(100%); + -o-filter: grayscale(100%); + filter: grayscale(100%); + filter: gray; + } + height: 100%; + width: 100%; + background-size: cover; + background-position: center; + overflow: hidden; + position: relative; + // 背景上面的半透明遮罩 + .layout-main-mask { + position: absolute; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + } + // 主体 + .layout-main { + position: absolute; + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + // [布局] 顶栏 + .el-header { + padding: 0px; + // logo区域 + .logo-group { + transition: width .3s; + float: left; + text-align: center; + img { + height: 60px; + } + } + // 折叠侧边栏切换按钮 + .toggle-aside-btn { + float: left; + height: 60px; + width: 60px; + display: flex; + justify-content: center; + align-items: center; + @extend %unable-select; + i { + font-size: 20px; + margin-top: 4px; + } + } + // [菜单] 顶栏 + .el-menu { + float: left; + border-bottom: none; + background-color: transparent; + %header-menu-item { + @extend %unable-select; + i.fa { + font-size: 16px; + margin-right: 4px; + } + } + .el-menu-item { + @extend %header-menu-item; + border-bottom: none; + } + .el-submenu { + @extend %header-menu-item; + .el-submenu__title { + border-bottom: none; + } + } + } + // 顶栏右侧的按钮 + .d2-header-right { + float: right; + height: 60px; + display: flex; + align-items: center; + .btn-text { + padding: 14px 12px; + border-radius: 4px; + margin: 0px !important; + margin-left: 10px !important; + } + .el-dropdown { + @extend %unable-select; + } + } + } + // [布局] 顶栏下面 + .el-container { + // 侧边栏 + .el-aside { + transition: width .3s; + overflow: auto; + // [菜单] 正常状态 + .el-menu { + @extend %unable-select; + background-color: transparent; + border-right: none; + .el-menu-item { + i { + margin-left: 4px; + margin-right: 5px; + font-size: 16px; + } + } + } + .el-submenu { + @extend %unable-select; + .el-submenu__title { + i { + margin-left: 4px; + margin-right: 5px; + font-size: 16px; + } + .el-submenu__icon-arrow { + margin-top: -10px; + } + } + } + // 菜单为空的时候显示的信息 + .menu-empty { + height: 160px; + margin: 10px; + margin-top: 0px; + border-radius: 4px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + @extend %unable-select; + i { + font-size: 30px; + margin-bottom: 10px; + } + span { + font-size: 14px; + } + } + // [菜单] 折叠状态 + .el-menu--collapse { + background-color: transparent; + .el-submenu__title { + text-align: center; + } + } + } + // 右下 主体 + .el-main { + padding: 0px; + position: relative; + overflow: hidden; + display: flex; + flex-direction: column; + // 主体部分分为多页面控制器 和主体 + .d2-layout-main-header { + flex-grow: 0; + // 多页面控制器 + .d2-multiple-page-control { + .el-tabs__header.is-top { + margin: 0px; + margin-right: 20px; + } + .el-tabs__nav { + overflow: hidden; + } + } + } + // 主体 + .d2-layout-main-body { + flex-grow: 1; + position: relative; + // 布局组件 + .container-component { + // 卡片布局组件 + .d2-container-card { + border-top-left-radius: 0px; + border-top-right-radius: 0px; + } + // 隐形布局组件 这个组件不建议在有多页面导航的时候使用 不美观 + .d2-container-ghost { + margin-right: 20px; + margin-bottom: 20px; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/assets/style/theme/theme.scss b/src/assets/style/theme/theme.scss new file mode 100644 index 00000000..0ef7efc4 --- /dev/null +++ b/src/assets/style/theme/theme.scss @@ -0,0 +1,269 @@ +// 每个主题特有的设置 +.theme-#{$theme-name} { + + // 背景图片和遮罩 + .layout-main-group { + background-color: $theme-bg-color; + .layout-main-mask { + background: $theme-bg-mask; + } + } + + // 菜单项目 + @mixin theme-menu-hover-style { + color: $theme-menu-item-color-hover; + i.fa { + color: $theme-menu-item-color-hover; + } + background: $theme-menu-item-background-color-hover; + } + .el-submenu__title { + @extend %unable-select; + i.fa { margin-right: 5px; } + } + .el-menu-item { + @extend %unable-select; + i.fa { margin-right: 5px; } + } + .el-submenu__title:hover { + @include theme-menu-hover-style; + } + .el-menu-item:hover { + @include theme-menu-hover-style; + } + .el-menu--horizontal .el-menu-item:not(.is-disabled):hover { + @include theme-menu-hover-style; + } + .el-menu--horizontal .el-menu .el-submenu__title:hover { + @include theme-menu-hover-style; + } + + // 顶栏 + .el-header { + // 切换按钮 + .toggle-aside-btn { + i { + color: $theme-header-item-color; + background: $theme-header-item-background-color; + &:hover { + color: $theme-header-item-color-hover; + } + } + } + // 顶栏菜单 + .el-menu { + .el-menu-item { + transition: border-top-color 0s; + color: $theme-header-item-color; + background: $theme-header-item-background-color; + i.fa { color: inherit; } + &:hover { + color: $theme-header-item-color-hover; + background: $theme-header-item-background-color-hover; + i.fa { color: inherit; } + } + &:focus { + color: $theme-header-item-color-focus; + background: $theme-header-item-background-color-focus; + i.fa { color: inherit; } + } + &.is-active { + color: $theme-header-item-color-active; + background: $theme-header-item-background-color-active; + i.fa { color: inherit; } + } + } + .el-submenu { + .el-submenu__title { + transition: border-top-color 0s; + color: $theme-header-item-color; + background: $theme-header-item-background-color; + i.fa { color: inherit; } + .el-submenu__icon-arrow { + color: $theme-header-item-color; + } + &:hover { + color: $theme-header-item-color-hover; + background: $theme-header-item-background-color-hover; + i.fa { color: inherit; } + .el-submenu__icon-arrow { + color: $theme-header-item-color-hover; + } + } + &:focus { + color: $theme-header-item-color-focus; + background: $theme-header-item-background-color-focus; + i.fa { color: inherit; } + .el-submenu__icon-arrow { + color: $theme-header-item-color-focus; + } + } + } + } + } + // 顶栏右侧 + .d2-header-right { + .btn-text { + color: $theme-header-item-color; + &.can-hover { + &:hover { + color: $theme-header-item-color-hover; + background: $theme-header-item-background-color-hover; + } + } + } + } + } + // [布局] 顶栏下面 + .el-container { + // 侧边栏 + .el-aside { + // 菜单为空的时候显示的信息 + .menu-empty { + background: $theme-aside-menu-empty-background-color; + i { + color: $theme-aside-menu-empty-icon-color; + } + span { + color: $theme-aside-menu-empty-text-color; + } + &:hover { + background: $theme-aside-menu-empty-background-color-hover; + i { + color: $theme-aside-menu-empty-icon-color-hover; + } + span { + color: $theme-aside-menu-empty-text-color-hover; + } + } + } + // [菜单] 正常状态 + .el-menu { + .el-menu-item { + color: $theme-aside-item-color; + background: $theme-aside-item-background-color; + i { + color: $theme-aside-item-color; + } + &:hover { + color: $theme-aside-item-color-hover; + background: $theme-aside-item-background-color-hover; + i { + color: $theme-aside-item-color-hover; + } + } + &:focus { + color: $theme-aside-item-color-focus; + background: $theme-aside-item-background-color-focus; + i { + color: $theme-aside-item-color-focus; + } + } + &.is-active { + color: $theme-aside-item-color-active; + background: $theme-aside-item-background-color-active; + i { + color: $theme-aside-item-color-active; + } + } + } + } + .el-submenu { + .el-submenu__title { + color: $theme-aside-item-color; + background: $theme-aside-item-background-color; + i { + color: $theme-aside-item-color; + } + .el-submenu__icon-arrow { + color: $theme-aside-item-color; + } + &:hover { + color: $theme-aside-item-color-hover; + background: $theme-aside-item-background-color-hover; + i { + color: $theme-aside-item-color-hover; + } + .el-submenu__icon-arrow { + color: $theme-aside-item-color-hover; + } + } + } + } + } + .el-main { + // 主体部分分为多页面控制器 和主体 + .d2-layout-main-header { + // 多页面控制器 + .d2-multiple-page-control { + .el-tabs__header.is-top { + border-bottom-color: $theme-multiple-page-control-border-color; + } + .el-tabs__nav { + border-color: $theme-multiple-page-control-border-color; + .el-tabs__item { + color: $theme-multiple-page-control-color; + background-color: $theme-multiple-page-control-background-color; + border-left-color: $theme-multiple-page-control-border-color; + &:first-child { + border-left: none; + } + } + .el-tabs__item.is-active { + color: $theme-multiple-page-control-color-active; + background-color: $theme-multiple-page-control-background-color-active; + border-bottom-color: $theme-multiple-page-control-border-color-active; + } + } + %el-tabs__nav { + font-size: 20px; + } + .el-tabs__nav-prev { + @extend %el-tabs__nav; + color: $theme-multiple-page-control-nav-prev-color; + } + .el-tabs__nav-next { + @extend %el-tabs__nav; + color: $theme-multiple-page-control-nav-next-color; + } + } + } + // 主体 + .d2-layout-main-body { + // 布局组件 + .container-component { + // [组件] d2-container-full + .d2-container-full { + border: $theme-container-border-outer; + border-top: none; + border-bottom: none; + .d2-container-full__header { + border-bottom: $theme-container-border-inner; + background: $theme-container-header-footer-background-color; + } + .d2-container-full__body { + background: $theme-container-background-color; + } + .d2-container-full__footer { + border-top: $theme-container-border-inner; + background: $theme-container-header-footer-background-color; + } + } + // [组件] d2-container-card + .d2-container-card { + border: $theme-container-border-outer; + border-top: none; + background: transparent; + .el-card__header { + border-bottom: $theme-container-border-inner; + background: $theme-container-header-footer-background-color; + } + .el-card__body { + background: $theme-container-background-color; + } + } + } + } + } + } +} diff --git a/src/assets/style/theme/theme.scss.REMOVED.git-id b/src/assets/style/theme/theme.scss.REMOVED.git-id deleted file mode 100644 index ce9131f8..00000000 --- a/src/assets/style/theme/theme.scss.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -bb297fb7228fc3fc2f78d50a734fc279a0d04e7e \ No newline at end of file