Skip to content

Commit 4f0194f

Browse files
gjdonkersbrc-dd
andauthored
fix(theme): move background colors to theme-default style (#1347)
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 parent 0565c38 commit 4f0194f

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

src/client/theme-default/components/VPBackdrop.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defineProps<{
1818
bottom: 0;
1919
left: 0;
2020
z-index: var(--vp-z-index-backdrop);
21-
background: rgba(0, 0, 0, .6);
21+
background: var(--vp-c-bg-backdrop);
2222
transition: opacity 0.5s;
2323
}
2424

src/client/theme-default/components/VPNav.vue

+8-13
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,17 @@ provide('close-screen', closeScreen)
4242
}
4343
4444
.VPNav.no-sidebar {
45-
-webkit-backdrop-filter: saturate(50%) blur(8px);
46-
backdrop-filter: saturate(50%) blur(8px);
47-
background: rgba(255, 255, 255, 0.7);
45+
background: var(--vp-c-bg-alpha-without-backdrop);
4846
}
4947
50-
.dark .VPNav.no-sidebar {
51-
background: rgba(36, 36, 36, 0.7);
52-
}
53-
54-
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
48+
@supports (
49+
(backdrop-filter: saturate(50%) blur(8px)) or
50+
(-webkit-backdrop-filter: saturate(50%) blur(8px))
51+
) {
5552
.VPNav.no-sidebar {
56-
background: rgba(255, 255, 255, 0.95);
57-
}
58-
59-
.dark .VPNav.no-sidebar {
60-
background: rgba(36, 36, 36, 0.95);
53+
-webkit-backdrop-filter: saturate(50%) blur(8px);
54+
backdrop-filter: saturate(50%) blur(8px);
55+
background: var(--vp-c-bg-alpha-with-backdrop);
6156
}
6257
}
6358
}

src/client/theme-default/components/VPNavBar.vue

+10-15
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,19 @@ const { hasSidebar } = useSidebar()
7070
}
7171
7272
.VPNavBar.has-sidebar .content {
73-
margin-right: -32px;
74-
padding-right: 32px;
75-
-webkit-backdrop-filter: saturate(50%) blur(8px);
76-
backdrop-filter: saturate(50%) blur(8px);
77-
background: rgba(255, 255, 255, 0.7);
73+
margin-right: -100vw;
74+
padding-right: 100vw;
75+
background: var(--vp-c-bg-alpha-without-backdrop);
7876
}
7977
80-
.dark .VPNavBar.has-sidebar .content {
81-
background: rgba(36, 36, 36, 0.7);
82-
}
83-
84-
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
78+
@supports (
79+
(backdrop-filter: saturate(50%) blur(8px)) or
80+
(-webkit-backdrop-filter: saturate(50%) blur(8px))
81+
) {
8582
.VPNavBar.has-sidebar .content {
86-
background: rgba(255, 255, 255, 0.95);
87-
}
88-
89-
.dark .VPNavBar.has-sidebar .content {
90-
background: rgba(36, 36, 36, 0.95);
83+
-webkit-backdrop-filter: saturate(50%) blur(8px);
84+
backdrop-filter: saturate(50%) blur(8px);
85+
background: var(--vp-c-bg-alpha-with-backdrop);
9186
}
9287
}
9388
}

src/client/theme-default/styles/vars.css

+8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
--vp-c-bg-mute: var(--vp-c-white-mute);
8989
--vp-c-bg-alt: var(--vp-c-white-soft);
9090

91+
--vp-c-bg-alpha-with-backdrop: rgba(255, 255, 255, 0.7);
92+
--vp-c-bg-alpha-without-backdrop: rgba(255, 255, 255, 0.95);
93+
94+
--vp-c-bg-backdrop: rgba(0, 0, 0, 0.6);
95+
9196
--vp-c-divider: var(--vp-c-divider-light-1);
9297
--vp-c-divider-light: var(--vp-c-divider-light-2);
9398

@@ -121,6 +126,9 @@
121126
--vp-c-bg-mute: var(--vp-c-gray-dark-3);
122127
--vp-c-bg-alt: var(--vp-c-black);
123128

129+
--vp-c-bg-alpha-with-backdrop: rgba(36, 36, 36, 0.7);
130+
--vp-c-bg-alpha-without-backdrop: rgba(36, 36, 36, 0.95);
131+
124132
--vp-c-divider: var(--vp-c-divider-dark-1);
125133
--vp-c-divider-light: var(--vp-c-divider-dark-2);
126134

0 commit comments

Comments
 (0)