Skip to content

Commit c83eacc

Browse files
committed
Mise à jour du mode sombre de l'application en fonction de la variable d'environnement SESAME_APP_DARK_MODE
1 parent 2176b17 commit c83eacc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

nuxt.config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ import { defineNuxtConfig } from 'nuxt/config'
66

77
const SESAME_APP_API_URL = process.env.SESAME_APP_API_URL || 'http://localhost:4002'
88

9+
let SESAME_APP_DARK_MODE: 'auto' | boolean = false
10+
if (process.env.SESAME_APP_DARK_MODE) {
11+
if (process.env.SESAME_APP_DARK_MODE === 'auto') {
12+
SESAME_APP_DARK_MODE = 'auto'
13+
} else {
14+
SESAME_APP_DARK_MODE = /true|on|yes|1/i.test(process.env.SESAME_APP_DARK_MODE)
15+
}
16+
}
17+
918
// https://nuxt.com/docs/api/configuration/nuxt-config
10-
// noinspection JSUnusedGlobalSymbols
1119
export default defineNuxtConfig({
1220
ssr: false,
1321
telemetry: false,
@@ -101,7 +109,7 @@ export default defineNuxtConfig({
101109
iconSet: 'mdi-v5',
102110
plugins: ['Notify', 'Dialog'],
103111
config: {
104-
dark: false,
112+
dark: SESAME_APP_DARK_MODE,
105113
notify: {
106114
timeout: 2500,
107115
position: 'top-right',

src/assets/sass/global.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body.body--dark
2121
.q-editor__content
2222
color: $dark
2323
background-color: $tooltip-color
24-
.tk-sticky-last-column-table
24+
.sesame-sticky-last-column-table
2525
thead tr:last-child th:last-child
2626
background-color: $dark
2727
td:last-child

0 commit comments

Comments
 (0)