mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-11 17:45:32 +00:00
13 lines
390 B
JavaScript
13 lines
390 B
JavaScript
import { append, element } from 'svelte/internal'
|
|
import { writable } from 'simple-store-svelte'
|
|
|
|
const style = element('style')
|
|
style.id = 'customThemes'
|
|
append(document.head, style)
|
|
|
|
export const variables = writable(localStorage.getItem('theme') || '')
|
|
|
|
variables.subscribe(value => {
|
|
localStorage.setItem('theme', value)
|
|
style.textContent = `:root{${value.replaceAll('}', '')}}`
|
|
})
|