From 1595c7d3e6a2b945a7350df7fddd4127a6eafd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 3 Jul 2018 21:45:57 +0800 Subject: [PATCH] Switch theme completion --- scripts/AddlocalIdentName.js | 5 ++++- src/components/GlobalHeader/index.less | 6 ++++-- src/components/SettingDarwer/index.js | 1 + src/pages/Dashboard/Analysis.less | 7 +++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/AddlocalIdentName.js b/scripts/AddlocalIdentName.js index 8c6a0889..a7764c20 100644 --- a/scripts/AddlocalIdentName.js +++ b/scripts/AddlocalIdentName.js @@ -24,13 +24,16 @@ const LocalIdentNameplugin = postcss.plugin('LocalIdentNameplugin', ({ localIden return; } // 删除 :global(className) 保留 className - if (item.selector && !item.selector.includes('(')) { + if (item.selector) { if (item.selector.includes(':global(')) { // converted :global(.className) const className = item.selector.match(/:global\((\S*)\)/)[1]; item.selector = className; return; } + if (item.selector.includes('(')) { + return; + } const className = item.selector.replace(/\./g, `.${localIdentName}`); item.selector = className; } diff --git a/src/components/GlobalHeader/index.less b/src/components/GlobalHeader/index.less index f1928d4c..ad305210 100644 --- a/src/components/GlobalHeader/index.less +++ b/src/components/GlobalHeader/index.less @@ -56,8 +56,10 @@ i.trigger { vertical-align: middle; color: @text-color; } - &:hover, - &:global(.ant-popover-open) { + &:hover { + background: @primary-1; + } + :global(&.ant-popover-open) { background: @primary-1; } } diff --git a/src/components/SettingDarwer/index.js b/src/components/SettingDarwer/index.js index e11595ed..d3950294 100644 --- a/src/components/SettingDarwer/index.js +++ b/src/components/SettingDarwer/index.js @@ -133,6 +133,7 @@ class SettingDarwer extends PureComponent { window.less .modifyVars({ '@primary-color': color, + '@input-hover-border-color': color, }) .then(() => { hideMessage(); diff --git a/src/pages/Dashboard/Analysis.less b/src/pages/Dashboard/Analysis.less index cd1d43ba..dc2319cb 100644 --- a/src/pages/Dashboard/Analysis.less +++ b/src/pages/Dashboard/Analysis.less @@ -119,10 +119,9 @@ position: relative; right: 6px; } - } - - :global(.ant-tabs-tab-active) h4 { - color: @primary-color; + .ant-tabs-tab-active h4 { + color: @primary-color; + } } } -- GitLab