Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a447366

Browse files
authored
fix(style): dark mode on some mobile devices (#33)
1 parent b26e921 commit a447366

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

app/layouts/default.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ onMounted(() => {
4141
</script>
4242

4343
<template>
44-
<div class="min-h-screen w-full bg-gray-50 flex flex-row dark:bg-gray-900">
44+
<div class="min-h-screen w-full flex flex-row ">
4545
<div
4646
class="fixed z-9999 left-0 top-0 md:relative h-screen max-h-screen flex flex-col p-5 transition-all duration-300 ease-in-out overflow-hidden"
4747
:class="`${(collapsed ? 'w-4/5 md:w-80 shadow-lg' : 'w-20 bg-transparent md:bg-gray-200')} bg-gray-200 dark:bg-gray-800`">
@@ -94,4 +94,18 @@ onMounted(() => {
9494
.fade-leave-to {
9595
opacity: 0;
9696
}
97+
98+
</style>
99+
100+
<style>
101+
:root {
102+
--at-apply: bg-gray-50;
103+
}
104+
105+
@media(prefers-color-scheme: dark) {
106+
:root {
107+
--at-apply: bg-gray-900;
108+
}
109+
}
110+
97111
</style>

unocss.config.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { defineConfig, presetWind3, presetAttributify } from 'unocss'
1+
import {
2+
defineConfig,
3+
presetWind3,
4+
presetAttributify,
5+
transformerDirectives,
6+
} from "unocss";
27

38
export default defineConfig({
4-
presets: [
5-
presetWind3(),
6-
presetAttributify(),
7-
],
8-
})
9+
presets: [presetWind3(), presetAttributify()],
10+
transformers: [transformerDirectives()],
11+
});
12+

0 commit comments

Comments
 (0)