From 74bd0f328e209efa75b984f8b8d8fd5ae6d65c6a Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Mon, 11 Jun 2018 09:24:20 +0800 Subject: [PATCH 01/33] no message Former-commit-id: ccc85bbb37276320246c4d7c1f362904b84430d5 Former-commit-id: 829dfc50bdac1be42031fe8d3a4a815f79535315 Former-commit-id: 04da360f1110e9033f5571ea1901f8f1d89a5db7 --- .../-header-right/components/-theme.vue | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/components/core/d2-layout-main/components/-header-right/components/-theme.vue b/src/components/core/d2-layout-main/components/-header-right/components/-theme.vue index b838edb6..d7802460 100644 --- a/src/components/core/d2-layout-main/components/-header-right/components/-theme.vue +++ b/src/components/core/d2-layout-main/components/-header-right/components/-theme.vue @@ -5,22 +5,16 @@ - - - - - + + + + +
- + +
@@ -32,16 +26,20 @@ export default { data () { return { dialogVisible: false, - tableData: [ - { - name: 'd2admin', - preview: '/static/image/theme-preview/d2admin@2x.png' - }, - { - name: 'star', - preview: '/static/image/theme-preview/star@2x.png' - } - ] + table: { + data: [ + { + name: 'd2admin', + preview: '/static/image/theme-preview/d2admin@2x.png' + }, + { + name: 'star', + preview: '/static/image/theme-preview/star@2x.png' + } + ], + showHeader: false, + border: true + } } } } From bb50ad2b63d1c6f576799e5e871dd822b0fb120b Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Mon, 11 Jun 2018 09:42:38 +0800 Subject: [PATCH 02/33] no message Former-commit-id: 36430ec3572727c263defaef7f08b4baf9cd79b8 Former-commit-id: 501e3c9de8d231b96a5e447dd9d9c5271d024cb5 Former-commit-id: d45a3e8ae5176a800a1c28897cb1908ebce89731 --- docs/zh/guide/change-log.md | 1 + src/assets/style/theme/d2admin/index.scss | 129 +++++++++++++++++++ src/components/core/d2-layout-main/index.vue | 4 + src/main.js | 5 +- 4 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 src/assets/style/theme/d2admin/index.scss diff --git a/docs/zh/guide/change-log.md b/docs/zh/guide/change-log.md index 8af971e0..e5571582 100644 --- a/docs/zh/guide/change-log.md +++ b/docs/zh/guide/change-log.md @@ -11,6 +11,7 @@ * [ 修复 ] 首次加载 loading 样式类名和程序内类名冲突,新的加载类名使用 `d2-app-loading` 前缀 * [ 修改 ] 所有类似 `dd-` 的样式前缀(包括自动注册图标的id前缀)统一改为 `d2-` * [ 修复 ] 修复 `highlight` 组件和 `markdown` 组件的样式冲突 +* [ 修改 ] 内置组件名称统一改为 `d2-` 前缀,统一使用横线连接 (kebab-case) 风格 ## v1.0.0 diff --git a/src/assets/style/theme/d2admin/index.scss b/src/assets/style/theme/d2admin/index.scss new file mode 100644 index 00000000..d5e2ab9e --- /dev/null +++ b/src/assets/style/theme/d2admin/index.scss @@ -0,0 +1,129 @@ +@import '../theme.scss'; + +$theme-name: 'd2admin'; +$theme-bg-color: #EFF4F8; +// $theme-bg-image: '/static/image/bg/star.jpg'; +$theme-container-full-border-color: #d8dfea; + +.theme-#{$theme-name} { + .theme { + background-color: $theme-bg-color; + background-size: cover; + background-position: center; + } + // 菜单项目 + @mixin theme-menu-hover-style { + background-color: #eff4f8; + } + .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; + } + // [组件] d2-container-full + .d2-container-full { + .d2-container-full__header { + border-bottom: 1px solid $theme-container-full-border-color; + } + .d2-container-full__footer { + border-top: 1px solid $theme-container-full-border-color; + } + } + // 顶栏 + .el-header { + // 切换按钮 + .toggle-aside-btn { + i { + color: #FFF; + &:hover { + color: #FFF; + } + } + } + // 顶栏菜单 + .el-menu { + .el-menu-item { + transition: border-top-color 0s; + color: #FFF; + &:hover { + background-color: rgba(#FFF, .3); + } + &:focus { + background-color: rgba(#FFF, .3); + } + &.is-active { + background-color: rgba(#000, .3); + } + } + .el-submenu { + .el-submenu__title { + transition: border-top-color 0s; + color: #FFF; + &:hover { + background-color: rgba(#FFF, .3); + } + &:focus { + background-color: rgba(#FFF, .3); + } + .el-submenu__icon-arrow { + color: #FFF; + } + } + } + } + // 顶栏右侧 + .d2-header-right { + .btn-text { + color: #FFF; + &:hover { + background-color: rgba(#FFF, .1); + } + } + } + } + // [布局] 顶栏下面 + .el-container { + // 侧边栏 + .el-aside { + // [菜单] 正常状态 + .el-menu { + .el-menu-item { + color: #FFF; + &:hover { + background-color: rgba(#FFF, .3); + } + &:focus { + background-color: rgba(#FFF, .3); + } + i { + color: #FFF; + } + &.is-active { + background-color: rgba(#000, .3); + } + } + } + .el-submenu { + .el-submenu__title { + color: #FFF; + &:hover { + background-color: rgba(#FFF, .3); + } + i { + color: #FFF; + } + .el-submenu__icon-arrow { + color: #FFF; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/components/core/d2-layout-main/index.vue b/src/components/core/d2-layout-main/index.vue index c4b081ab..817346a2 100644 --- a/src/components/core/d2-layout-main/index.vue +++ b/src/components/core/d2-layout-main/index.vue @@ -44,11 +44,15 @@ export default { // [侧边栏宽度] 折叠状态 asideWidthCollapse: '65px' } + }, + mounted () { + document.body.className = 'theme-star' } } diff --git a/src/main.js b/src/main.js index 2b862006..0135ca41 100755 --- a/src/main.js +++ b/src/main.js @@ -57,8 +57,5 @@ new Vue({ i18n, router, template: '', - components: { App }, - mounted () { - document.body.className = 'theme-star' - } + components: { App } }) From 3bcd8c51e439796605c8ea86ec04c65097ed15c4 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Mon, 11 Jun 2018 10:00:02 +0800 Subject: [PATCH 03/33] no message Former-commit-id: 75387e28983051ce24404b9295d64e9d2a8a96f9 Former-commit-id: 6db2187d27f42fb3b6baf48519dde7f20e85406d Former-commit-id: 699d4b032b5cd67314a1de5181527af206f74ac1 --- src/assets/style/theme/star/index.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/style/theme/star/index.scss b/src/assets/style/theme/star/index.scss index ade5965a..e349c479 100644 --- a/src/assets/style/theme/star/index.scss +++ b/src/assets/style/theme/star/index.scss @@ -3,7 +3,7 @@ $theme-name: 'star'; $theme-bg-color: #EFF4F8; $theme-bg-image: '/static/image/bg/star.jpg'; -$theme-container-full-border-color: #d8dfea; +$theme-container-border-color: #d8dfea; .theme-#{$theme-name} { .theme { @@ -31,10 +31,10 @@ $theme-container-full-border-color: #d8dfea; // [组件] d2-container-full .d2-container-full { .d2-container-full__header { - border-bottom: 1px solid $theme-container-full-border-color; + border-bottom: 1px solid $theme-container-border-color; } .d2-container-full__footer { - border-top: 1px solid $theme-container-full-border-color; + border-top: 1px solid $theme-container-border-color; } } // 顶栏 From 444214d448757d7ad1b30ebd0b66fbae825e1311 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Mon, 11 Jun 2018 10:41:42 +0800 Subject: [PATCH 04/33] no message Former-commit-id: 5e50d6b200ff2da546a94c7261335d163877685d Former-commit-id: 72b2a0609e3cc724fe20b706ca42bf0930b33fd9 Former-commit-id: 359c3c40ba7e34c90c2b8293482ebe73fdb9fd56 --- src/assets/style/theme/star/index.scss | 97 +++++++++++++------- src/assets/style/theme/theme.scss | 2 +- src/components/core/d2-container/index.vue | 2 +- src/components/core/d2-layout-main/index.vue | 2 +- 4 files changed, 68 insertions(+), 35 deletions(-) diff --git a/src/assets/style/theme/star/index.scss b/src/assets/style/theme/star/index.scss index e349c479..7b8f0b89 100644 --- a/src/assets/style/theme/star/index.scss +++ b/src/assets/style/theme/star/index.scss @@ -1,12 +1,36 @@ @import '../theme.scss'; +// 主题名称 $theme-name: 'star'; +// 主题背景颜色 $theme-bg-color: #EFF4F8; +// 主题背景图片 $theme-bg-image: '/static/image/bg/star.jpg'; -$theme-container-border-color: #d8dfea; +// container组件的边框 +$theme-container-border: 1px solid #d8dfea; +// 顶栏和侧边栏中展开的菜单 hover 状态下的文字和图标颜色 +$theme-menu-item-color-hover: #FFF; +// 顶栏和侧边栏中展开的菜单 hover 状态下的背景颜色 +$theme-menu-item-background-color-hover: #187181; +// 顶栏上的文字颜色 +$theme-header-text-color: #FFF; +// 顶栏上的项目在 hover 时的背景颜色 +$theme-header-item-background-color-hover: rgba(#FFF, .3); +// 顶栏上的项目在 focus 时的背景颜色 +$theme-header-item-background-color-focus: rgba(#FFF, .3); +// 顶栏上的项目在 active 时的背景颜色 +$theme-header-item-background-color-active: rgba(#000, .3); +// 侧边栏上的文字颜色 +$theme-aside-text-color: #FFF; +// 侧边栏上的项目在 hover 时的背景颜色 +$theme-aside-item-background-color-hover: rgba(#FFF, .3); +// 顶栏上的项目在 focus 时的背景颜色 +$theme-aside-item-background-color-focus: rgba(#FFF, .3); +// 侧边栏上的项目在 active 时的背景颜色 +$theme-aside-item-background-color-active: rgba(#000, .3); .theme-#{$theme-name} { - .theme { + .layout-main { background-color: $theme-bg-color; background-image: url($theme-bg-image); background-size: cover; @@ -14,7 +38,11 @@ $theme-container-border-color: #d8dfea; } // 菜单项目 @mixin theme-menu-hover-style { - background-color: #eff4f8; + color: $theme-menu-item-color-hover; + i { + color: $theme-menu-item-color-hover; + } + background-color: $theme-menu-item-background-color-hover; } .el-submenu__title:hover { @include theme-menu-hover-style; @@ -28,23 +56,28 @@ $theme-container-border-color: #d8dfea; .el-menu--horizontal .el-menu .el-submenu__title:hover { @include theme-menu-hover-style; } + // [组件] d2-container-full .d2-container-full { .d2-container-full__header { - border-bottom: 1px solid $theme-container-border-color; + border-bottom: $theme-container-border; } .d2-container-full__footer { - border-top: 1px solid $theme-container-border-color; + border-top: $theme-container-border; } } + // [组件] d2-container-card + .d2-container-card { + border: $theme-container-border; + } // 顶栏 .el-header { // 切换按钮 .toggle-aside-btn { i { - color: #FFF; + color: $theme-header-text-color; &:hover { - color: #FFF; + color: $theme-header-text-color; } } } @@ -52,29 +85,29 @@ $theme-container-border-color: #d8dfea; .el-menu { .el-menu-item { transition: border-top-color 0s; - color: #FFF; + color: $theme-header-text-color; &:hover { - background-color: rgba(#FFF, .3); + background-color: $theme-header-item-background-color-hover; } &:focus { - background-color: rgba(#FFF, .3); + background-color: $theme-header-item-background-color-focus; } &.is-active { - background-color: rgba(#000, .3); + background-color: $theme-header-item-background-color-active; } } .el-submenu { .el-submenu__title { transition: border-top-color 0s; - color: #FFF; + color: $theme-header-text-color; + .el-submenu__icon-arrow { + color: $theme-header-text-color; + } &:hover { - background-color: rgba(#FFF, .3); + background-color: $theme-header-item-background-color-hover; } &:focus { - background-color: rgba(#FFF, .3); - } - .el-submenu__icon-arrow { - color: #FFF; + background-color: $theme-header-item-background-color-focus; } } } @@ -82,9 +115,9 @@ $theme-container-border-color: #d8dfea; // 顶栏右侧 .d2-header-right { .btn-text { - color: #FFF; + color: $theme-header-text-color; &:hover { - background-color: rgba(#FFF, .1); + background-color: $theme-header-item-background-color-hover; } } } @@ -96,32 +129,32 @@ $theme-container-border-color: #d8dfea; // [菜单] 正常状态 .el-menu { .el-menu-item { - color: #FFF; + color: $theme-aside-text-color; + i { + color: $theme-aside-text-color; + } &:hover { - background-color: rgba(#FFF, .3); + background-color: $theme-aside-item-background-color-hover; } &:focus { - background-color: rgba(#FFF, .3); - } - i { - color: #FFF; + background-color: $theme-aside-item-background-color-focus; } &.is-active { - background-color: rgba(#000, .3); + background-color: $theme-aside-item-background-color-active; } } } .el-submenu { .el-submenu__title { - color: #FFF; - &:hover { - background-color: rgba(#FFF, .3); - } + color: $theme-aside-text-color; i { - color: #FFF; + color: $theme-aside-text-color; } .el-submenu__icon-arrow { - color: #FFF; + color: $theme-aside-text-color; + } + &:hover { + background-color: $theme-aside-item-background-color-hover; } } } diff --git a/src/assets/style/theme/theme.scss b/src/assets/style/theme/theme.scss index 3f1af9ed..7d46d1aa 100644 --- a/src/assets/style/theme/theme.scss +++ b/src/assets/style/theme/theme.scss @@ -1,7 +1,7 @@ @import '~@/assets/style/public.scss'; // 主题公用 -.theme { +.layout-main { height: 100vh; width: 100vw; // [布局] 顶栏 diff --git a/src/components/core/d2-container/index.vue b/src/components/core/d2-container/index.vue index 71bb2f08..55a7e549 100644 --- a/src/components/core/d2-container/index.vue +++ b/src/components/core/d2-container/index.vue @@ -1,7 +1,7 @@