@descope/sdk-mixins
Advanced tools
Comparing version 0.1.16 to 0.1.17
@@ -589,12 +589,10 @@ 'use strict'; | ||
get theme() { | ||
return 'light'; | ||
// for now we use only light since dark theme is not well supported in widgets, should enable below once supported | ||
// const theme = this.getAttribute('theme') as ThemeOptions | null; | ||
// if (theme === 'os') { | ||
// const isOsDark = | ||
// window.matchMedia && | ||
// window.matchMedia?.('(prefers-color-scheme: dark)')?.matches; | ||
// return isOsDark ? 'dark' : 'light'; | ||
// } | ||
// return theme || 'light'; | ||
var _a, _b; | ||
const theme = this.getAttribute('theme'); | ||
if (theme === 'os') { | ||
const isOsDark = window.matchMedia && | ||
((_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-color-scheme: dark)')) === null || _b === void 0 ? void 0 : _b.matches); | ||
return isOsDark ? 'dark' : 'light'; | ||
} | ||
return theme || 'light'; | ||
} | ||
@@ -601,0 +599,0 @@ async init() { |
@@ -587,12 +587,10 @@ import { __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib'; | ||
get theme() { | ||
return 'light'; | ||
// for now we use only light since dark theme is not well supported in widgets, should enable below once supported | ||
// const theme = this.getAttribute('theme') as ThemeOptions | null; | ||
// if (theme === 'os') { | ||
// const isOsDark = | ||
// window.matchMedia && | ||
// window.matchMedia?.('(prefers-color-scheme: dark)')?.matches; | ||
// return isOsDark ? 'dark' : 'light'; | ||
// } | ||
// return theme || 'light'; | ||
var _a, _b; | ||
const theme = this.getAttribute('theme'); | ||
if (theme === 'os') { | ||
const isOsDark = window.matchMedia && | ||
((_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(prefers-color-scheme: dark)')) === null || _b === void 0 ? void 0 : _b.matches); | ||
return isOsDark ? 'dark' : 'light'; | ||
} | ||
return theme || 'light'; | ||
} | ||
@@ -599,0 +597,0 @@ async init() { |
{ | ||
"name": "@descope/sdk-mixins", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"author": "Descope Team <info@descope.com>", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/descope/sdk-mixins", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
571653
7196