admin-lte 4.0.0 → 4.0.1
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/CHANGELOG.md +21 -0
- package/README.md +185 -111
- package/dist/UI/general.html +27 -3
- package/dist/UI/icons.html +27 -3
- package/dist/UI/timeline.html +27 -3
- package/dist/docs/browser-support.html +27 -3
- package/dist/docs/color-mode.html +27 -3
- package/dist/docs/components/main-header.html +27 -3
- package/dist/docs/components/main-sidebar.html +27 -3
- package/dist/docs/customization.html +27 -3
- package/dist/docs/deployment.html +27 -3
- package/dist/docs/faq.html +27 -3
- package/dist/docs/getting-started.html +27 -3
- package/dist/docs/how-to-contribute.html +27 -3
- package/dist/docs/integrations.html +27 -3
- package/dist/docs/introduction.html +27 -3
- package/dist/docs/javascript/accessibility.html +27 -3
- package/dist/docs/javascript/card-widget.html +27 -3
- package/dist/docs/javascript/direct-chat.html +27 -3
- package/dist/docs/javascript/fullscreen.html +27 -3
- package/dist/docs/javascript/layout.html +27 -3
- package/dist/docs/javascript/plugins-overview.html +27 -3
- package/dist/docs/javascript/pushmenu.html +27 -3
- package/dist/docs/javascript/treeview.html +27 -3
- package/dist/docs/layout-blueprint.html +27 -3
- package/dist/docs/layout.html +27 -3
- package/dist/docs/license.html +27 -3
- package/dist/docs/migration.html +27 -3
- package/dist/docs/recipes.html +27 -3
- package/dist/docs/rtl.html +27 -3
- package/dist/examples/lockscreen.html +26 -0
- package/dist/examples/login-v2.html +26 -0
- package/dist/examples/login.html +26 -0
- package/dist/examples/register-v2.html +26 -0
- package/dist/examples/register.html +26 -0
- package/dist/forms/elements.html +27 -3
- package/dist/forms/layout.html +27 -3
- package/dist/forms/validation.html +27 -3
- package/dist/forms/wizard.html +27 -3
- package/dist/generate/theme.html +26 -0
- package/dist/index.html +27 -3
- package/dist/index2.html +27 -3
- package/dist/index3.html +27 -3
- package/dist/js/adminlte.js +4 -1
- package/dist/js/adminlte.js.map +1 -1
- package/dist/js/adminlte.min.js +2 -2
- package/dist/js/adminlte.min.js.map +1 -1
- package/dist/layout/collapsed-sidebar-without-hover.html +27 -3
- package/dist/layout/collapsed-sidebar.html +27 -3
- package/dist/layout/fixed-complete.html +27 -3
- package/dist/layout/fixed-footer.html +27 -3
- package/dist/layout/fixed-header.html +27 -3
- package/dist/layout/fixed-sidebar.html +27 -3
- package/dist/layout/layout-custom-area.html +27 -3
- package/dist/layout/layout-rtl.html +27 -3
- package/dist/layout/logo-switch.html +26 -0
- package/dist/layout/sidebar-mini.html +27 -3
- package/dist/layout/unfixed-sidebar.html +27 -3
- package/dist/mailbox/compose.html +27 -3
- package/dist/mailbox/inbox.html +43 -11
- package/dist/mailbox/read.html +27 -3
- package/dist/pages/404.html +26 -0
- package/dist/pages/500.html +26 -0
- package/dist/pages/calendar.html +27 -3
- package/dist/pages/chat.html +27 -3
- package/dist/pages/faq.html +27 -3
- package/dist/pages/file-manager.html +27 -3
- package/dist/pages/invoice.html +27 -3
- package/dist/pages/kanban.html +27 -3
- package/dist/pages/maintenance.html +26 -0
- package/dist/pages/pricing.html +27 -3
- package/dist/pages/profile.html +27 -3
- package/dist/pages/projects.html +27 -3
- package/dist/pages/settings.html +27 -3
- package/dist/tables/data.html +27 -3
- package/dist/tables/simple.html +27 -3
- package/dist/widgets/cards.html +27 -3
- package/dist/widgets/info-box.html +27 -3
- package/dist/widgets/small-box.html +27 -3
- package/github-issue-response.md +40 -0
- package/package.json +14 -13
- package/src/ts/accessibility.ts +9 -1
package/dist/pages/invoice.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Invoice</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -365,13 +391,11 @@
|
|
|
365
391
|
<!--end::Sidebar Brand-->
|
|
366
392
|
<!--begin::Sidebar Wrapper-->
|
|
367
393
|
<div class="sidebar-wrapper">
|
|
368
|
-
<nav class="mt-2">
|
|
394
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
369
395
|
<!--begin::Sidebar Menu-->
|
|
370
396
|
<ul
|
|
371
397
|
class="nav sidebar-menu flex-column"
|
|
372
398
|
data-lte-toggle="treeview"
|
|
373
|
-
role="navigation"
|
|
374
|
-
aria-label="Main navigation"
|
|
375
399
|
data-accordion="false"
|
|
376
400
|
id="navigation"
|
|
377
401
|
>
|
package/dist/pages/kanban.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Kanban Board</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -444,13 +470,11 @@
|
|
|
444
470
|
<!--end::Sidebar Brand-->
|
|
445
471
|
<!--begin::Sidebar Wrapper-->
|
|
446
472
|
<div class="sidebar-wrapper">
|
|
447
|
-
<nav class="mt-2">
|
|
473
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
448
474
|
<!--begin::Sidebar Menu-->
|
|
449
475
|
<ul
|
|
450
476
|
class="nav sidebar-menu flex-column"
|
|
451
477
|
data-lte-toggle="treeview"
|
|
452
|
-
role="navigation"
|
|
453
|
-
aria-label="Main navigation"
|
|
454
478
|
data-accordion="false"
|
|
455
479
|
id="navigation"
|
|
456
480
|
>
|
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Maintenance</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
package/dist/pages/pricing.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Pricing</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -365,13 +391,11 @@
|
|
|
365
391
|
<!--end::Sidebar Brand-->
|
|
366
392
|
<!--begin::Sidebar Wrapper-->
|
|
367
393
|
<div class="sidebar-wrapper">
|
|
368
|
-
<nav class="mt-2">
|
|
394
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
369
395
|
<!--begin::Sidebar Menu-->
|
|
370
396
|
<ul
|
|
371
397
|
class="nav sidebar-menu flex-column"
|
|
372
398
|
data-lte-toggle="treeview"
|
|
373
|
-
role="navigation"
|
|
374
|
-
aria-label="Main navigation"
|
|
375
399
|
data-accordion="false"
|
|
376
400
|
id="navigation"
|
|
377
401
|
>
|
package/dist/pages/profile.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | User Profile</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -365,13 +391,11 @@
|
|
|
365
391
|
<!--end::Sidebar Brand-->
|
|
366
392
|
<!--begin::Sidebar Wrapper-->
|
|
367
393
|
<div class="sidebar-wrapper">
|
|
368
|
-
<nav class="mt-2">
|
|
394
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
369
395
|
<!--begin::Sidebar Menu-->
|
|
370
396
|
<ul
|
|
371
397
|
class="nav sidebar-menu flex-column"
|
|
372
398
|
data-lte-toggle="treeview"
|
|
373
|
-
role="navigation"
|
|
374
|
-
aria-label="Main navigation"
|
|
375
399
|
data-accordion="false"
|
|
376
400
|
id="navigation"
|
|
377
401
|
>
|
package/dist/pages/projects.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Projects</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -365,13 +391,11 @@
|
|
|
365
391
|
<!--end::Sidebar Brand-->
|
|
366
392
|
<!--begin::Sidebar Wrapper-->
|
|
367
393
|
<div class="sidebar-wrapper">
|
|
368
|
-
<nav class="mt-2">
|
|
394
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
369
395
|
<!--begin::Sidebar Menu-->
|
|
370
396
|
<ul
|
|
371
397
|
class="nav sidebar-menu flex-column"
|
|
372
398
|
data-lte-toggle="treeview"
|
|
373
|
-
role="navigation"
|
|
374
|
-
aria-label="Main navigation"
|
|
375
399
|
data-accordion="false"
|
|
376
400
|
id="navigation"
|
|
377
401
|
>
|
package/dist/pages/settings.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Settings</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -365,13 +391,11 @@
|
|
|
365
391
|
<!--end::Sidebar Brand-->
|
|
366
392
|
<!--begin::Sidebar Wrapper-->
|
|
367
393
|
<div class="sidebar-wrapper">
|
|
368
|
-
<nav class="mt-2">
|
|
394
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
369
395
|
<!--begin::Sidebar Menu-->
|
|
370
396
|
<ul
|
|
371
397
|
class="nav sidebar-menu flex-column"
|
|
372
398
|
data-lte-toggle="treeview"
|
|
373
|
-
role="navigation"
|
|
374
|
-
aria-label="Main navigation"
|
|
375
399
|
data-accordion="false"
|
|
376
400
|
id="navigation"
|
|
377
401
|
>
|
package/dist/tables/data.html
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
5
|
<title>AdminLTE 4 | Data Tables</title>
|
|
6
6
|
|
|
7
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
8
|
+
<script>
|
|
9
|
+
(() => {
|
|
10
|
+
'use strict';
|
|
11
|
+
const STORAGE_KEY = 'lte-theme';
|
|
12
|
+
let stored = null;
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
20
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
21
|
+
let resolved = 'light';
|
|
22
|
+
if (stored === 'dark' || stored === 'light') {
|
|
23
|
+
resolved = stored;
|
|
24
|
+
} else if (prefersDark) {
|
|
25
|
+
resolved = 'dark';
|
|
26
|
+
}
|
|
27
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
28
|
+
document.documentElement.style.colorScheme = resolved;
|
|
29
|
+
})();
|
|
30
|
+
</script>
|
|
31
|
+
<!--end::Theme Init-->
|
|
32
|
+
|
|
7
33
|
<!--begin::Accessibility Meta Tags-->
|
|
8
34
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
9
35
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -370,13 +396,11 @@
|
|
|
370
396
|
<!--end::Sidebar Brand-->
|
|
371
397
|
<!--begin::Sidebar Wrapper-->
|
|
372
398
|
<div class="sidebar-wrapper">
|
|
373
|
-
<nav class="mt-2">
|
|
399
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
374
400
|
<!--begin::Sidebar Menu-->
|
|
375
401
|
<ul
|
|
376
402
|
class="nav sidebar-menu flex-column"
|
|
377
403
|
data-lte-toggle="treeview"
|
|
378
|
-
role="navigation"
|
|
379
|
-
aria-label="Main navigation"
|
|
380
404
|
data-accordion="false"
|
|
381
405
|
id="navigation"
|
|
382
406
|
>
|
package/dist/tables/simple.html
CHANGED
|
@@ -5,6 +5,32 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
6
|
<title>AdminLTE 4 | Simple Tables</title>
|
|
7
7
|
|
|
8
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
9
|
+
<script>
|
|
10
|
+
(() => {
|
|
11
|
+
'use strict';
|
|
12
|
+
const STORAGE_KEY = 'lte-theme';
|
|
13
|
+
let stored = null;
|
|
14
|
+
try {
|
|
15
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
16
|
+
} catch {
|
|
17
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
18
|
+
}
|
|
19
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
20
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
21
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
22
|
+
let resolved = 'light';
|
|
23
|
+
if (stored === 'dark' || stored === 'light') {
|
|
24
|
+
resolved = stored;
|
|
25
|
+
} else if (prefersDark) {
|
|
26
|
+
resolved = 'dark';
|
|
27
|
+
}
|
|
28
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
29
|
+
document.documentElement.style.colorScheme = resolved;
|
|
30
|
+
})();
|
|
31
|
+
</script>
|
|
32
|
+
<!--end::Theme Init-->
|
|
33
|
+
|
|
8
34
|
<!--begin::Accessibility Meta Tags-->
|
|
9
35
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
10
36
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -369,13 +395,11 @@
|
|
|
369
395
|
<!--end::Sidebar Brand-->
|
|
370
396
|
<!--begin::Sidebar Wrapper-->
|
|
371
397
|
<div class="sidebar-wrapper">
|
|
372
|
-
<nav class="mt-2">
|
|
398
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
373
399
|
<!--begin::Sidebar Menu-->
|
|
374
400
|
<ul
|
|
375
401
|
class="nav sidebar-menu flex-column"
|
|
376
402
|
data-lte-toggle="treeview"
|
|
377
|
-
role="navigation"
|
|
378
|
-
aria-label="Main navigation"
|
|
379
403
|
data-accordion="false"
|
|
380
404
|
id="navigation"
|
|
381
405
|
>
|
package/dist/widgets/cards.html
CHANGED
|
@@ -5,6 +5,32 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
6
|
<title>AdminLTE 4 | Widgets - Cards</title>
|
|
7
7
|
|
|
8
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
9
|
+
<script>
|
|
10
|
+
(() => {
|
|
11
|
+
'use strict';
|
|
12
|
+
const STORAGE_KEY = 'lte-theme';
|
|
13
|
+
let stored = null;
|
|
14
|
+
try {
|
|
15
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
16
|
+
} catch {
|
|
17
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
18
|
+
}
|
|
19
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
20
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
21
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
22
|
+
let resolved = 'light';
|
|
23
|
+
if (stored === 'dark' || stored === 'light') {
|
|
24
|
+
resolved = stored;
|
|
25
|
+
} else if (prefersDark) {
|
|
26
|
+
resolved = 'dark';
|
|
27
|
+
}
|
|
28
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
29
|
+
document.documentElement.style.colorScheme = resolved;
|
|
30
|
+
})();
|
|
31
|
+
</script>
|
|
32
|
+
<!--end::Theme Init-->
|
|
33
|
+
|
|
8
34
|
<!--begin::Accessibility Meta Tags-->
|
|
9
35
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
10
36
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -369,13 +395,11 @@
|
|
|
369
395
|
<!--end::Sidebar Brand-->
|
|
370
396
|
<!--begin::Sidebar Wrapper-->
|
|
371
397
|
<div class="sidebar-wrapper">
|
|
372
|
-
<nav class="mt-2">
|
|
398
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
373
399
|
<!--begin::Sidebar Menu-->
|
|
374
400
|
<ul
|
|
375
401
|
class="nav sidebar-menu flex-column"
|
|
376
402
|
data-lte-toggle="treeview"
|
|
377
|
-
role="navigation"
|
|
378
|
-
aria-label="Main navigation"
|
|
379
403
|
data-accordion="false"
|
|
380
404
|
id="navigation"
|
|
381
405
|
>
|
|
@@ -5,6 +5,32 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
6
|
<title>AdminLTE 4 | Widgets - Info Box</title>
|
|
7
7
|
|
|
8
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
9
|
+
<script>
|
|
10
|
+
(() => {
|
|
11
|
+
'use strict';
|
|
12
|
+
const STORAGE_KEY = 'lte-theme';
|
|
13
|
+
let stored = null;
|
|
14
|
+
try {
|
|
15
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
16
|
+
} catch {
|
|
17
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
18
|
+
}
|
|
19
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
20
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
21
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
22
|
+
let resolved = 'light';
|
|
23
|
+
if (stored === 'dark' || stored === 'light') {
|
|
24
|
+
resolved = stored;
|
|
25
|
+
} else if (prefersDark) {
|
|
26
|
+
resolved = 'dark';
|
|
27
|
+
}
|
|
28
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
29
|
+
document.documentElement.style.colorScheme = resolved;
|
|
30
|
+
})();
|
|
31
|
+
</script>
|
|
32
|
+
<!--end::Theme Init-->
|
|
33
|
+
|
|
8
34
|
<!--begin::Accessibility Meta Tags-->
|
|
9
35
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
10
36
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -369,13 +395,11 @@
|
|
|
369
395
|
<!--end::Sidebar Brand-->
|
|
370
396
|
<!--begin::Sidebar Wrapper-->
|
|
371
397
|
<div class="sidebar-wrapper">
|
|
372
|
-
<nav class="mt-2">
|
|
398
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
373
399
|
<!--begin::Sidebar Menu-->
|
|
374
400
|
<ul
|
|
375
401
|
class="nav sidebar-menu flex-column"
|
|
376
402
|
data-lte-toggle="treeview"
|
|
377
|
-
role="navigation"
|
|
378
|
-
aria-label="Main navigation"
|
|
379
403
|
data-accordion="false"
|
|
380
404
|
id="navigation"
|
|
381
405
|
>
|
|
@@ -5,6 +5,32 @@
|
|
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
6
|
<title>AdminLTE 4 | Widgets - Small Box</title>
|
|
7
7
|
|
|
8
|
+
<!--begin::Theme Init (prevents flash of incorrect theme on load, #6043)-->
|
|
9
|
+
<script>
|
|
10
|
+
(() => {
|
|
11
|
+
'use strict';
|
|
12
|
+
const STORAGE_KEY = 'lte-theme';
|
|
13
|
+
let stored = null;
|
|
14
|
+
try {
|
|
15
|
+
stored = localStorage.getItem(STORAGE_KEY);
|
|
16
|
+
} catch {
|
|
17
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
18
|
+
}
|
|
19
|
+
const prefersDark = globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
20
|
+
// Mirror the resolution in _scripts.astro: explicit "dark"/"light" win,
|
|
21
|
+
// otherwise ("auto" or unset) fall back to the OS preference.
|
|
22
|
+
let resolved = 'light';
|
|
23
|
+
if (stored === 'dark' || stored === 'light') {
|
|
24
|
+
resolved = stored;
|
|
25
|
+
} else if (prefersDark) {
|
|
26
|
+
resolved = 'dark';
|
|
27
|
+
}
|
|
28
|
+
document.documentElement.setAttribute('data-bs-theme', resolved);
|
|
29
|
+
document.documentElement.style.colorScheme = resolved;
|
|
30
|
+
})();
|
|
31
|
+
</script>
|
|
32
|
+
<!--end::Theme Init-->
|
|
33
|
+
|
|
8
34
|
<!--begin::Accessibility Meta Tags-->
|
|
9
35
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
10
36
|
<meta name="color-scheme" content="light dark" />
|
|
@@ -369,13 +395,11 @@
|
|
|
369
395
|
<!--end::Sidebar Brand-->
|
|
370
396
|
<!--begin::Sidebar Wrapper-->
|
|
371
397
|
<div class="sidebar-wrapper">
|
|
372
|
-
<nav class="mt-2">
|
|
398
|
+
<nav class="mt-2" aria-label="Main navigation">
|
|
373
399
|
<!--begin::Sidebar Menu-->
|
|
374
400
|
<ul
|
|
375
401
|
class="nav sidebar-menu flex-column"
|
|
376
402
|
data-lte-toggle="treeview"
|
|
377
|
-
role="navigation"
|
|
378
|
-
aria-label="Main navigation"
|
|
379
403
|
data-accordion="false"
|
|
380
404
|
id="navigation"
|
|
381
405
|
>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Thanks for the thorough write-up @bsshreesha — your root-cause analysis is spot on, and you even guessed the correct storage key (`lte-theme`). Reproduced and fixed. 👍
|
|
2
|
+
|
|
3
|
+
As you noted, the color-mode script lives in `_scripts.astro`, which is loaded at the **end of `<body>`**. So the browser paints the default (light) theme first, then the script swaps `data-bs-theme` once it runs — hence the flash for dark-mode users on every load.
|
|
4
|
+
|
|
5
|
+
**Fix:** I added a small render-blocking inline script to `_head.astro` (shared by every page), essentially your suggestion with a few refinements:
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<script is:inline>
|
|
9
|
+
;(() => {
|
|
10
|
+
"use strict"
|
|
11
|
+
const STORAGE_KEY = "lte-theme"
|
|
12
|
+
let stored = null
|
|
13
|
+
try {
|
|
14
|
+
stored = localStorage.getItem(STORAGE_KEY)
|
|
15
|
+
} catch {
|
|
16
|
+
// localStorage may be unavailable (private mode, sandboxed iframe).
|
|
17
|
+
}
|
|
18
|
+
const prefersDark = globalThis.matchMedia(
|
|
19
|
+
"(prefers-color-scheme: dark)"
|
|
20
|
+
).matches
|
|
21
|
+
const resolved =
|
|
22
|
+
stored === "dark" || stored === "light"
|
|
23
|
+
? stored
|
|
24
|
+
: prefersDark
|
|
25
|
+
? "dark"
|
|
26
|
+
: "light"
|
|
27
|
+
document.documentElement.setAttribute("data-bs-theme", resolved)
|
|
28
|
+
document.documentElement.style.colorScheme = resolved
|
|
29
|
+
})()
|
|
30
|
+
</script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Refinements vs. the snippet in the issue:
|
|
34
|
+
- **Mirrors the resolution already in `_scripts.astro`** so the stored `"auto"` value (and the unset case) consistently falls back to `prefers-color-scheme` — keeps the head and body logic in sync.
|
|
35
|
+
- **`try/catch` around `localStorage`** so it degrades gracefully where storage access throws (private mode, sandboxed iframes) instead of leaving the page un-themed.
|
|
36
|
+
- Placed right after `<title>`, before the stylesheet, so `data-bs-theme` is set before the first paint.
|
|
37
|
+
|
|
38
|
+
**Verified:** with `lte-theme=dark` set, a probe reading `document.documentElement.getAttribute("data-bs-theme")` at the very first line of `<body>` already returns `"dark"` — i.e. the theme is applied before any body content is laid out, so there's no flash. Pages now render directly in the stored theme on refresh.
|
|
39
|
+
|
|
40
|
+
Changed in `src/html/components/_head.astro` and the rebuilt `dist` (applies to all pages). It'll be in the next release. Thanks again for the detailed report and suggested fix!
|