wave-ui 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-ui",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
5
5
  "author": "Antoni Andre <antoniandre.web@gmail.com>",
6
6
  "homepage": "https://antoniandre.github.io/wave-ui",
@@ -56,7 +56,7 @@ export default class WaveUI {
56
56
  },
57
57
 
58
58
  // Callable from this.$waveui.
59
- switchTheme (theme) {
59
+ switchTheme (theme, skipFlatten = false) {
60
60
  this.theme = theme
61
61
  document.documentElement.setAttribute('data-theme', theme)
62
62
  document.head.querySelector('#wave-ui-colors')?.remove?.()
@@ -104,12 +104,9 @@ export default class WaveUI {
104
104
  wApp.classList.add('w-app')
105
105
 
106
106
  let themeColors = config.colors[config.theme]
107
- if (config.theme === 'auto') {
108
- detectOSDarkMode($waveui)
109
- themeColors = config.colors[$waveui.preferredTheme]
110
- $waveui.colors = flattenColors(themeColors, colorPalette)
111
- }
112
- injectColorsCSSInDOM(themeColors)
107
+ if (config.theme === 'auto') detectOSDarkMode($waveui) // Also switches the theme.
108
+ else this.switchTheme(config.theme, true)
109
+
113
110
  injectCSSInDOM($waveui)
114
111
  injectNotifManagerInDOM(wApp, components, $waveui)
115
112