@_tc/template-core 0.2.5 → 0.2.6

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.
@@ -1,7 +1,26 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" class="dark">
2
+ <html lang="en" class="dark" style="color-scheme: dark">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
+ <script>
6
+ ;(() => {
7
+ const storageKey = 'tc_theme'
8
+ let mode = 'dark'
9
+
10
+ try {
11
+ const storedMode = localStorage.getItem(storageKey)
12
+ if (storedMode === 'light' || storedMode === 'dark') {
13
+ mode = storedMode
14
+ }
15
+ } catch (error) {
16
+ // Keep the template default when localStorage is unavailable.
17
+ }
18
+
19
+ const root = document.documentElement
20
+ root.classList.toggle('dark', mode === 'dark')
21
+ root.style.colorScheme = mode
22
+ })()
23
+ </script>
5
24
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
25
  <link rel="icon" type="image/x-icon" href="/static/logo.png" />
7
26
  <title>{{ name }}</title>
@@ -1,7 +1,26 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" class="dark">
2
+ <html lang="en" class="dark" style="color-scheme: dark">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
+ <script>
6
+ ;(() => {
7
+ const storageKey = 'tc_theme'
8
+ let mode = 'dark'
9
+
10
+ try {
11
+ const storedMode = localStorage.getItem(storageKey)
12
+ if (storedMode === 'light' || storedMode === 'dark') {
13
+ mode = storedMode
14
+ }
15
+ } catch (error) {
16
+ // Keep the template default when localStorage is unavailable.
17
+ }
18
+
19
+ const root = document.documentElement
20
+ root.classList.toggle('dark', mode === 'dark')
21
+ root.style.colorScheme = mode
22
+ })()
23
+ </script>
5
24
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
25
  <link rel="icon" type="image/x-icon" href="/static/logo.png" />
7
26
  <title>{{ name }}</title>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_tc/template-core",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "A full-stack TypeScript admin framework powered by Koa, React, and Vite - monorepo root",
5
5
  "types": "./types/index.d.ts",
6
6
  "exports": {