Skip to content

Commit daef343

Browse files
committed
fix: data-theme not updating after browser history navigation
1 parent bb49112 commit daef343

File tree

7 files changed

+10
-6
lines changed

7 files changed

+10
-6
lines changed

frontend/assets/css/colors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
--toast-background-error-color: var(--pastel-red);
155155
--toast-border-error-color: var(--bold-red);
156156

157-
&.dark-mode {
157+
&[data-theme=dark] {
158158
--primary-color: var(--primary-orange);
159159
--primary-contrast-color: var(--light-black);
160160
--primary-contrast-color-discreet: var(--dark-grey);

frontend/assets/css/prime_datatable.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--expander-col-width: 53px;
55
--table-header-background: var(--grey-4);
66

7-
&.dark-mode {
7+
&[data-theme=dark] {
88
--table-header-background: var(--very-dark-grey);
99
}
1010
}

frontend/components/bc/BcBlurOverlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
height: 75%;
1111
}
1212
13-
.dark-mode {
13+
[data-theme=dark] {
1414
.gradient-blur {
1515
background: linear-gradient(rgba(35, 32, 36, 0), rgba(35, 32, 36, 1));
1616
}

frontend/components/bc/BcToggleIcon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const toggle = () => {
108108
}
109109
}
110110
111-
.dark-mode .bc-toggle .bg {
111+
[data-theme=dark] .bc-toggle .bg {
112112
background-color: var(--graphite);
113113
border-color: var(--graphite);
114114
}

frontend/components/bc/BcTooltip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ onUnmounted(() => {
428428
}
429429
}
430430
431-
.dark-mode {
431+
[data-theme=dark] {
432432
.bc-tooltip {
433433
&.special {
434434
--tt-bg-color: var(--light-black);

frontend/components/dashboard/table/SummaryStatus.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const mapped = computed(() => {
7878
/* unfortunatly we can't use our css variables here as the rgba conversion is done during build process and there is no css native possibility */
7979
@include set-pulse-anmiation(#4e7451);
8080
81-
.dark-mode {
81+
[data-theme=dark] {
8282
@include set-pulse-anmiation(#7dc382);
8383
}
8484

frontend/layers/base/app/components/BaseColormode.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const cookie = useBcCookie<'dark' | 'light'>('theme')
44
colorMode.preference = cookie.value || 'dark'
55
const handleUpdate = () => {
66
cookie.value = colorMode.preference as 'dark' | 'light'
7+
// due to a bug in @nuxtjs/color-mode
8+
// `data-theme` does not update when after user comes back to the app
9+
// using browser back/forward buttons
10+
document.documentElement.dataset.theme = colorMode.preference
711
}
812
</script>
913

0 commit comments

Comments
 (0)