Vibecoded CI/CD
This commit is contained in:
17
frontend/public/preboot.js
Normal file
17
frontend/public/preboot.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Apply saved theme & accent before first paint to avoid a flash.
|
||||
*
|
||||
* This is the desktop build's copy of the inline snippet nuxt.config.ts puts
|
||||
* in <head> for the web (keep the two in step). Out here as a file because a
|
||||
* window may be held to a Content Security Policy — see src-tauri/README.md —
|
||||
* and `script-src 'self'` would have no room for a script written inline in
|
||||
* the HTML.
|
||||
* A classic <script src> in <head> still runs before the page paints, so the
|
||||
* surfaces arrive already the right way round. */
|
||||
try {
|
||||
var d = document.documentElement
|
||||
var s = localStorage.getItem('mathew-theme')
|
||||
var t = s || (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
||||
d.setAttribute('data-theme', t)
|
||||
var a = localStorage.getItem('mathew-accent')
|
||||
if (a && a !== 'violet') d.setAttribute('data-accent', a)
|
||||
} catch (e) {}
|
||||
Reference in New Issue
Block a user