1234567891011121314151617181920212223242526272829303132333435 |
- /*!
- * Tabler v1.0.0-beta18 (https://tabler.io)
- * @version 1.0.0-beta18
- * @link https://tabler.io
- * Copyright 2018-2023 The Tabler Authors
- * Copyright 2018-2023 codecalm.net Paweł Kuna
- * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
- */
- (function (factory) {
- typeof define === 'function' && define.amd ? define(factory) :
- factory();
- })((function () { 'use strict';
- var themeStorageKey = "tablerTheme";
- var defaultTheme = "light";
- var selectedTheme;
- var params = new Proxy(new URLSearchParams(window.location.search), {
- get: function get(searchParams, prop) {
- return searchParams.get(prop);
- }
- });
- if (!!params.theme) {
- localStorage.setItem(themeStorageKey, params.theme);
- selectedTheme = params.theme;
- } else {
- var storedTheme = localStorage.getItem(themeStorageKey);
- selectedTheme = storedTheme ? storedTheme : defaultTheme;
- }
- if (selectedTheme === 'dark') {
- document.body.setAttribute("data-bs-theme", selectedTheme);
- } else {
- document.body.removeAttribute("data-bs-theme");
- }
- }));
|