@3mo/theme
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -1,2 +0,2 @@ | ||
import { css, unsafeCSS } from '@a11d/lit'; | ||
import { css, isServer, unsafeCSS } from '@a11d/lit'; | ||
import { RootCssInjector } from '@a11d/root-css-injector'; | ||
@@ -26,3 +26,3 @@ import { LocalStorage } from '@a11d/local-storage'; | ||
value = this.parseColor(value) || this.parseColorSet(value); | ||
if (!value) { | ||
if (!isServer && !value) { | ||
window.localStorage.removeItem(this.name); | ||
@@ -29,0 +29,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { isServer } from '@a11d/lit'; | ||
import { LocalStorage } from '@a11d/local-storage'; | ||
@@ -11,2 +12,4 @@ export var Background; | ||
super('Theme.Background', Background.System); | ||
if (isServer) | ||
return; | ||
window.matchMedia('(prefers-color-scheme: dark)').onchange = () => this.updateAttributeValue(); | ||
@@ -20,3 +23,3 @@ window.matchMedia('(prefers-color-scheme: light)').onchange = () => this.updateAttributeValue(); | ||
? this.value | ||
: window.matchMedia('(prefers-color-scheme: dark)').matches | ||
: (!isServer && window.matchMedia('(prefers-color-scheme: dark)').matches) | ||
? Background.Dark | ||
@@ -23,0 +26,0 @@ : Background.Light; |
{ | ||
"name": "@3mo/theme", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Tools & tokens for theming 3MO components & applications.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
87134
280