diff --git a/public/theme/element-extra.css b/public/theme/element-extra.css index c89c44f5b..a1b1b4769 100644 --- a/public/theme/element-extra.css +++ b/public/theme/element-extra.css @@ -11,17 +11,14 @@ color: light-2; } -.el-select-dropdown__item.hover, .el-select-dropdown__item:hover { - background-color: primary; - color: white!important; -} - .el-pagination.is-background .el-pager li:not(.disabled):hover { color: white; background-color: primary; } -.el-pagination.is-background .btn-next, .el-pagination.is-background .btn-prev, .el-pagination.is-background .el-pager li { +.el-pagination.is-background .btn-next, +.el-pagination.is-background .btn-prev, +.el-pagination.is-background .el-pager li { margin: 0 5px; background-color: white; color: #606266; @@ -311,7 +308,9 @@ td .el-button.el-button--mini { border-bottom: 1px solid #e7e7e7 !important; } -.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell { +.el-table .cell, +.el-table--border td:first-child .cell, +.el-table--border th:first-child .cell { padding-left: 10px; padding-right: 14px; } diff --git a/src/styles/element-variables.scss b/public/theme/element-variables.scss similarity index 100% rename from src/styles/element-variables.scss rename to public/theme/element-variables.scss diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss deleted file mode 100644 index 2bc8f0a72..000000000 --- a/src/styles/element-ui.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "./variables"; - - - - - diff --git a/src/styles/var.scss b/src/styles/var.scss index 019106692..e245695b1 100644 --- a/src/styles/var.scss +++ b/src/styles/var.scss @@ -1,7 +1,7 @@ /* 参考根目录下的 element-variables */ /* 切记此处不修改配置,以element-variables为准,可适当增加自定义配置 */ /* 如果要修改element-variables,请执行npm run build_theme更新主题 */ -@import "./element-variables.scss"; +@import "../../public/theme/element-variables.scss"; :export { name: "scss"; diff --git a/src/utils/theme/color.js b/src/utils/theme/color.js index 0ebbea6d5..4e066f27d 100644 --- a/src/utils/theme/color.js +++ b/src/utils/theme/color.js @@ -15,7 +15,8 @@ export const matchColor = { export function generateColors(primary) { const colors = {} - const otherColor = themeOptions[primary] || defaultThemeConfigValue || {} + const themeConfig = _.findKey(themeOptions, ['--color-primary', primary]) + const otherColor = themeOptions[themeConfig] || defaultThemeConfigValue Object.keys(formula).forEach((key) => { let value @@ -72,7 +73,8 @@ export function mix(color_1, color_2, weight) { } export function changeSidebarColor(primary) { - const colors = themeOptions[primary] || defaultThemeConfigValue || {} + const themeConfig = _.findKey(themeOptions, ['--color-primary', primary]) + const colors = themeOptions[themeConfig] || defaultThemeConfigValue || {} const elementStyle = document.documentElement.style for (const key in colors) { @@ -84,6 +86,5 @@ export function changeSidebarColor(primary) { elementStyle.setProperty('--submenu-bg', mix('000000', changeColor, 20)) elementStyle.setProperty('--submenu-hover', mix('000000', changeColor, 30)) } - elementStyle.setProperty('--color-primary', primary) } } diff --git a/src/utils/theme/themeConfigs/chinese_red.js b/src/utils/theme/themeConfigs/chinese_red.js index c86097b67..12a01a6ef 100644 --- a/src/utils/theme/themeConfigs/chinese_red.js +++ b/src/utils/theme/themeConfigs/chinese_red.js @@ -1,5 +1,6 @@ const config = { - '#bd1a2d': { + chinese_red: { + '--color-primary': '#bd1a2d', '--color-success': '#E98737', '--color-info': '#f06f06', '--color-warning': '#f82ed3', diff --git a/src/utils/theme/themeConfigs/deep_black.js b/src/utils/theme/themeConfigs/deep_black.js index 26d97d829..7176a6cd3 100644 --- a/src/utils/theme/themeConfigs/deep_black.js +++ b/src/utils/theme/themeConfigs/deep_black.js @@ -1,5 +1,6 @@ const config = { - '#0576b9': { + deep_black: { + '--color-primary': '#0576b9', '--color-success': '#2cb57e', '--color-info': '#47bce8', '--color-warning': '#f5bd58', diff --git a/src/utils/theme/themeConfigs/default.js b/src/utils/theme/themeConfigs/default.js index 6b524d283..4fa754522 100644 --- a/src/utils/theme/themeConfigs/default.js +++ b/src/utils/theme/themeConfigs/default.js @@ -1,5 +1,6 @@ const config = { - '#1ab394': { + default: { + '--color-primary': '#1ab394', '--color-success': '#1c84c6', '--color-info': '#23c6c8', '--color-warning': '#f8ac59', diff --git a/src/utils/theme/themeConfigs/tech_blue.js b/src/utils/theme/themeConfigs/tech_blue.js index 253736003..019e86ce0 100644 --- a/src/utils/theme/themeConfigs/tech_blue.js +++ b/src/utils/theme/themeConfigs/tech_blue.js @@ -1,5 +1,6 @@ const config = { - '#174779': { + tech_blue: { + '--color-primary': '#174779', '--color-success': '#174779', '--color-info': '#17a2b8', '--color-warning': '#ffc107',