From b21e9019b81b3a9a944ef445ca52efebcb8900d6 Mon Sep 17 00:00:00 2001 From: Fine Date: Thu, 9 Nov 2023 11:26:04 +0800 Subject: [PATCH] feat: add popper theme --- src/layout/components/NavBar.vue | 3 +-- src/styles/theme.scss | 14 +++++++++++++- .../dashboard/controls/ContinuousProfiling.vue | 2 +- src/views/dashboard/controls/DemandLog.vue | 2 +- src/views/dashboard/controls/Ebpf.vue | 2 +- src/views/dashboard/controls/Event.vue | 2 +- src/views/dashboard/controls/Log.vue | 2 +- src/views/dashboard/controls/NetworkProfiling.vue | 2 +- src/views/dashboard/controls/Profile.vue | 2 +- src/views/dashboard/controls/TaskTimeline.vue | 6 ++---- src/views/dashboard/controls/Text.vue | 12 ++---------- src/views/dashboard/controls/ThirdPartyApp.vue | 12 ++---------- src/views/dashboard/controls/TimeRange.vue | 10 ++-------- src/views/dashboard/controls/Topology.vue | 12 ++---------- src/views/dashboard/controls/Trace.vue | 6 ++---- src/views/dashboard/controls/Widget.vue | 4 ++-- 16 files changed, 35 insertions(+), 58 deletions(-) diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index 7d85a69d..3fe33470 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -87,7 +87,7 @@ limitations under the License. --> const pathNames = ref<{ path?: string; name: string; selected: boolean }[][]>([]); const timeRange = ref(0); const pageTitle = ref(""); - const theme = ref(false); + const theme = ref(true); changeTheme(); resetDuration(); @@ -106,7 +106,6 @@ limitations under the License. --> root.classList.remove("dark"); appStore.setTheme("light"); } - console.log(appStore.theme); } function getName(list: any[]) { diff --git a/src/styles/theme.scss b/src/styles/theme.scss index eb712960..3882d241 100644 --- a/src/styles/theme.scss +++ b/src/styles/theme.scss @@ -28,10 +28,13 @@ html { --layout-background: #f7f9fa; --box-shadow-color: #ccc; --el-border: 1px solid #000000; + --el-bg-color-overlay: #fff; + --el-border-color-light: #e4e7ed; + --popper-hover-bg: #eee; } html.dark { - --el-color-primary: #409eff; + --el-color-primary: rgb(64, 158, 255); --theme-background: #212224; --font-color: #fafbfc; --disabled-color: #ccc; @@ -41,8 +44,17 @@ html.dark { --border-color-primary: #4b4b52; --layout-background: #000; --box-shadow-color: #666; + --el-bg-color-overlay: #1d1e1f; + --el-border-color-light: #414243; + --popper-hover-bg: rgb(64, 158, 255, 0.1); } +.el-popper.is-light { + background: var(--el-bg-color-overlay); + border: 1px solid var(--el-border-color-light); +} + +$popper-hover-bg-color: var(--popper-hover-bg); $box-shadow-color: var(--box-shadow-color); $border-color-primary: var(--border-color-primary); $layout-background: var(--layout-background); diff --git a/src/views/dashboard/controls/ContinuousProfiling.vue b/src/views/dashboard/controls/ContinuousProfiling.vue index 72bb7991..10030f8b 100644 --- a/src/views/dashboard/controls/ContinuousProfiling.vue +++ b/src/views/dashboard/controls/ContinuousProfiling.vue @@ -87,7 +87,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/DemandLog.vue b/src/views/dashboard/controls/DemandLog.vue index b3ad3cbb..d8c44b79 100644 --- a/src/views/dashboard/controls/DemandLog.vue +++ b/src/views/dashboard/controls/DemandLog.vue @@ -82,7 +82,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/Ebpf.vue b/src/views/dashboard/controls/Ebpf.vue index 2c49002f..9841e858 100644 --- a/src/views/dashboard/controls/Ebpf.vue +++ b/src/views/dashboard/controls/Ebpf.vue @@ -80,7 +80,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/Event.vue b/src/views/dashboard/controls/Event.vue index ed03bba0..2aa219a8 100644 --- a/src/views/dashboard/controls/Event.vue +++ b/src/views/dashboard/controls/Event.vue @@ -93,7 +93,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/Log.vue b/src/views/dashboard/controls/Log.vue index ed561cd4..2f7a8c1b 100644 --- a/src/views/dashboard/controls/Log.vue +++ b/src/views/dashboard/controls/Log.vue @@ -90,7 +90,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/NetworkProfiling.vue b/src/views/dashboard/controls/NetworkProfiling.vue index 35ea9bcc..5afc1113 100644 --- a/src/views/dashboard/controls/NetworkProfiling.vue +++ b/src/views/dashboard/controls/NetworkProfiling.vue @@ -79,7 +79,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/Profile.vue b/src/views/dashboard/controls/Profile.vue index 426e8ad3..81cdcadc 100644 --- a/src/views/dashboard/controls/Profile.vue +++ b/src/views/dashboard/controls/Profile.vue @@ -80,7 +80,7 @@ limitations under the License. --> &:hover { color: $active-color; - background-color: #eee; + background-color: $popper-hover-bg-color; } } diff --git a/src/views/dashboard/controls/TaskTimeline.vue b/src/views/dashboard/controls/TaskTimeline.vue index 58938217..6adc28e4 100644 --- a/src/views/dashboard/controls/TaskTimeline.vue +++ b/src/views/dashboard/controls/TaskTimeline.vue @@ -15,7 +15,7 @@ limitations under the License. -->