Skip to content

Commit 449c90e

Browse files
test
1 parent 925ae21 commit 449c90e

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

‎packages/vue/playground/App.vue‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { computed, reactive, ref, shallowRef } from 'vue';
2+
import { computed, onMounted, reactive, ref, shallowRef } from 'vue';
33
import { locale } from '@query-kit/vue';
44
import { generateRow } from './core/MockDataGenerator';
55
import RequestDisplay from './components/RequestDisplay.vue';
@@ -140,9 +140,22 @@ function onFieldClick(value, item, fieldId, event) {
140140
}
141141
142142
const theme = ref('auto');
143+
// Temporary diagnostic for the mobile dark-mode issue: `set` is the inline
144+
// color-scheme assigned to <html>, `computed` is what the browser resolves it
145+
// to. The template swatch uses light-dark() directly to show whether the forced
146+
// scheme actually flips colors.
147+
const themeDebug = ref({ set: '', computed: '' });
148+
function refreshThemeDebug() {
149+
themeDebug.value = {
150+
set: document.documentElement.style.colorScheme || '(unset)',
151+
computed: getComputedStyle(document.documentElement).colorScheme,
152+
};
153+
}
143154
function onThemeChange() {
144155
document.documentElement.style.colorScheme = theme.value === 'auto' ? 'light dark' : theme.value;
156+
refreshThemeDebug();
145157
}
158+
onMounted(refreshThemeDebug);
146159
</script>
147160
148161
<template>
@@ -174,6 +187,16 @@ function onThemeChange() {
174187
</select>
175188
</div>
176189
190+
<div
191+
class="theme-debug"
192+
style="margin: 8px 0; padding: 8px; border: 2px dashed currentColor; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font: 13px/1.4 monospace"
193+
>
194+
<span>select: <b>{{ theme }}</b></span>
195+
<span>style.colorScheme: <b>{{ themeDebug.set }}</b></span>
196+
<span>getComputedStyle: <b>{{ themeDebug.computed }}</b></span>
197+
<span style="padding: 4px 10px; border: 1px solid currentColor; background: light-dark(#fff, #111); color: light-dark(#111, #fff)">light-dark() swatch</span>
198+
</div>
199+
177200
<!-- Default -->
178201
<div v-if="activeTab === 'default'">
179202
<p class="playground-description">

0 commit comments

Comments
 (0)