admin-lte 4.4.1 → 4.8.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +1 -1
  3. package/dist/css/adminlte-colors-v3.css +2457 -0
  4. package/dist/css/adminlte-colors-v3.css.map +1 -0
  5. package/dist/css/adminlte-colors-v3.min.css +20 -0
  6. package/dist/css/adminlte-colors-v3.min.css.map +1 -0
  7. package/dist/css/adminlte-colors-v3.rtl.css +2456 -0
  8. package/dist/css/adminlte-colors-v3.rtl.css.map +1 -0
  9. package/dist/css/adminlte-colors-v3.rtl.min.css +20 -0
  10. package/dist/css/adminlte-colors-v3.rtl.min.css.map +1 -0
  11. package/dist/css/adminlte-colors.css +732 -114
  12. package/dist/css/adminlte-colors.css.map +1 -1
  13. package/dist/css/adminlte-colors.min.css +5 -3
  14. package/dist/css/adminlte-colors.min.css.map +1 -1
  15. package/dist/css/adminlte-colors.rtl.css +732 -114
  16. package/dist/css/adminlte-colors.rtl.css.map +1 -1
  17. package/dist/css/adminlte-colors.rtl.min.css +5 -3
  18. package/dist/css/adminlte-colors.rtl.min.css.map +1 -1
  19. package/dist/css/adminlte-docs.css +1 -1
  20. package/dist/css/adminlte-docs.css.map +1 -1
  21. package/dist/css/adminlte-docs.min.css +1 -1
  22. package/dist/css/adminlte-docs.min.css.map +1 -1
  23. package/dist/css/adminlte-docs.rtl.css +1 -1
  24. package/dist/css/adminlte-docs.rtl.css.map +1 -1
  25. package/dist/css/adminlte-docs.rtl.min.css +1 -1
  26. package/dist/css/adminlte-docs.rtl.min.css.map +1 -1
  27. package/dist/css/adminlte-select2.css +1 -1
  28. package/dist/css/adminlte-select2.css.map +1 -1
  29. package/dist/css/adminlte-select2.min.css +1 -1
  30. package/dist/css/adminlte-select2.min.css.map +1 -1
  31. package/dist/css/adminlte-select2.rtl.css +1 -1
  32. package/dist/css/adminlte-select2.rtl.css.map +1 -1
  33. package/dist/css/adminlte-select2.rtl.min.css +1 -1
  34. package/dist/css/adminlte-select2.rtl.min.css.map +1 -1
  35. package/dist/css/adminlte.css +17 -6
  36. package/dist/css/adminlte.css.map +1 -1
  37. package/dist/css/adminlte.min.css +2 -2
  38. package/dist/css/adminlte.min.css.map +1 -1
  39. package/dist/css/adminlte.rtl.css +17 -6
  40. package/dist/css/adminlte.rtl.css.map +1 -1
  41. package/dist/css/adminlte.rtl.min.css +2 -2
  42. package/dist/css/adminlte.rtl.min.css.map +1 -1
  43. package/dist/js/adminlte.esm.js +1 -1
  44. package/dist/js/adminlte.esm.min.js +1 -1
  45. package/dist/js/adminlte.js +1 -1
  46. package/dist/js/adminlte.min.js +1 -1
  47. package/package.json +1 -1
  48. package/src/scss/_accessibility.scss +36 -5
  49. package/src/scss/adminlte-colors-v3.scss +61 -0
  50. package/src/scss/adminlte-colors.scss +5 -2
  51. package/src/scss/adminlte-docs.scss +1 -1
  52. package/src/scss/adminlte-select2.scss +1 -1
  53. package/src/scss/adminlte.scss +1 -1
  54. package/src/scss/colors/_colors.scss +42 -8
  55. package/src/scss/colors/_primary.scss +276 -0
  56. package/src/scss/colors/_variables.scss +65 -0
  57. package/src/ts/adminlte.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 (https://adminlte.io)
2
+ * AdminLTE v4.8.1 (https://adminlte.io)
3
3
  * Copyright 2014-2026 Colorlib <https://colorlib.com>
4
4
  * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 (https://adminlte.io)
2
+ * AdminLTE v4.8.1 (https://adminlte.io)
3
3
  * Copyright 2014-2026 Colorlib <https://colorlib.com>
4
4
  * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 (https://adminlte.io)
2
+ * AdminLTE v4.8.1 (https://adminlte.io)
3
3
  * Copyright 2014-2026 Colorlib <https://colorlib.com>
4
4
  * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 (https://adminlte.io)
2
+ * AdminLTE v4.8.1 (https://adminlte.io)
3
3
  * Copyright 2014-2026 Colorlib <https://colorlib.com>
4
4
  * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
5
5
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "admin-lte",
3
3
  "description": "Responsive open source admin dashboard and control panel.",
4
- "version": "4.4.1",
4
+ "version": "4.8.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Colorlib <https://colorlib.com>",
@@ -21,9 +21,12 @@
21
21
  }
22
22
 
23
23
  &:hover {
24
- color: var(--bs-white);
24
+ // `--bs-primary-emphasis` does not exist; Bootstrap emits
25
+ // `--bs-primary-text-emphasis`, which is dark in light mode and light in
26
+ // dark mode — so pair it with the body background for the text colour.
27
+ color: var(--bs-body-bg);
25
28
  text-decoration: none;
26
- background: var(--bs-primary-emphasis);
29
+ background: var(--bs-primary-text-emphasis);
27
30
  }
28
31
  }
29
32
 
@@ -278,21 +281,49 @@ fieldset {
278
281
 
279
282
  /* Print Accessibility */
280
283
  @media print {
284
+ // Printers drop backgrounds, so anything that takes its text colour from one
285
+ // — a `.btn-primary`, a nav link on a coloured sidebar — would print white on
286
+ // nothing. Force legible ink instead.
281
287
  .skip-link,
282
288
  .btn,
283
289
  .nav-link {
284
290
  color: #000 !important;
285
291
  background: transparent !important;
292
+ }
293
+
294
+ // A button should still read as a button on paper. Nav links are ordinary
295
+ // text in print: the sidebar prints by design, so outlining every item put a
296
+ // black box around the whole menu, which was never the intent (#6108).
297
+ .btn {
286
298
  border: 1px solid #000 !important;
287
299
  }
288
300
 
301
+ // The HTML5 Boilerplate convention: a reader holding paper cannot follow a
302
+ // link, so print where it goes.
289
303
  a[href^="http"]::after {
290
304
  font-size: .8em;
291
305
  content: " (" attr(href) ")";
292
306
  }
293
307
 
294
- /* Print Layout Fix - Ensure sidebar and main content are both visible */
295
- .app-wrapper {
308
+ // `data-lte-print="plain"` — for pages that print as a document (invoice,
309
+ // quote, work order, packing slip) rather than as a copy of a web page: no
310
+ // URLs after links, no outline around buttons. Goes on <html>, <body> or any
311
+ // container; text stays black on white either way (#6108).
312
+ [data-lte-print="plain"] {
313
+ a[href^="http"]::after {
314
+ content: none;
315
+ }
316
+
317
+ .btn {
318
+ border-color: transparent !important;
319
+ }
320
+ }
321
+
322
+ /* Print Layout Fix - Ensure sidebar and main content are both visible.
323
+ `:not(.d-print-none)` on the two rules that force `display`, so Bootstrap's
324
+ print display utilities keep working: these are defaults for the standard
325
+ layout, not something a page should have to fight to hide. */
326
+ .app-wrapper:not(.d-print-none) {
296
327
  display: grid !important;
297
328
  grid-template-rows: auto 1fr auto !important;
298
329
  grid-template-columns: auto 1fr !important;
@@ -302,7 +333,7 @@ fieldset {
302
333
  display: none !important;
303
334
  }
304
335
 
305
- .app-sidebar {
336
+ .app-sidebar:not(.d-print-none) {
306
337
  position: static !important;
307
338
  display: block !important;
308
339
  min-width: 200px !important;
@@ -0,0 +1,61 @@
1
+ /*!
2
+ * AdminLTE v4.8.1 — AdminLTE 3 color palette (legacy)
3
+ * Opt-in. The extended colours exactly as AdminLTE 3 shipped them — same
4
+ * names, same values, same text-colour rule (Bootstrap 4's YIQ brightness
5
+ * test, so lightblue, olive and teal take white text as they did) — with
6
+ * the AdminLTE 4 class families: `.bg-*`, `.text-bg-*`, `.text-*`,
7
+ * `.border-*`, `.link-*`, `.bg-gradient-*`, `.card-*`, `.callout-*`,
8
+ * `.direct-chat-*`, plus dark-mode tokens — and `data-lte-primary="lightblue"`
9
+ * on <html> to make any of them Bootstrap's `primary`, buttons and all.
10
+ *
11
+ * Load EITHER this file OR adminlte-colors.css (the palette designed for
12
+ * 4.4), not both: they define the same class names (navy, teal, olive, …)
13
+ * with different values. Nothing here is in adminlte.css.
14
+ * See docs/colors.html.
15
+ *
16
+ * Author: Colorlib
17
+ * Website: AdminLTE.io <https://adminlte.io>
18
+ * License: Open source - MIT <https://opensource.org/licenses/MIT>
19
+ */
20
+
21
+ // Bootstrap Configuration
22
+ // ---------------------------------------------------
23
+ @import "bootstrap/scss/functions";
24
+ @import "bootstrap-overrides";
25
+ @import "bootstrap/scss/variables";
26
+ @import "bootstrap/scss/variables-dark";
27
+ @import "bootstrap/scss/maps";
28
+ @import "bootstrap/scss/mixins";
29
+
30
+ // AdminLTE Configuration
31
+ // ---------------------------------------------------
32
+ @import "variables";
33
+ @import "variables-dark";
34
+
35
+ // The AdminLTE 3 palette — values read from the 3.2.0 build, unchanged
36
+ // ---------------------------------------------------
37
+ $lte-palette: (
38
+ "lightblue": #3c8dbc,
39
+ "navy": #001f3f,
40
+ "olive": #3d9970,
41
+ "lime": #01ff70,
42
+ "fuchsia": #f012be,
43
+ "maroon": #d81b60,
44
+ "blue": #007bff,
45
+ "indigo": #6610f2,
46
+ "purple": #6f42c1,
47
+ "pink": #e83e8c,
48
+ "red": #dc3545,
49
+ "orange": #fd7e14,
50
+ "yellow": #ffc107,
51
+ "green": #28a745,
52
+ "teal": #20c997,
53
+ "cyan": #17a2b8,
54
+ "gray": #6c757d,
55
+ "gray-dark": #343a40
56
+ ) !default;
57
+ $lte-palette-contrast: "yiq" !default;
58
+
59
+ @import "colors/variables";
60
+ @import "colors/colors";
61
+ @import "colors/primary";
@@ -1,12 +1,14 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 — Extended color palette
2
+ * AdminLTE v4.8.1 — Extended color palette
3
3
  * Opt-in. Nothing here is in adminlte.css: load this sheet after it and you
4
4
  * get fourteen additional colours (orange, amber, olive, teal, sky, indigo,
5
5
  * violet, fuchsia, pink, navy, steel, slate, graphite, midnight) as `--bs-*`
6
6
  * tokens plus the
7
7
  * `.bg-*`, `.text-bg-*`, `.text-*`, `.border-*`, `.link-*`, `.bg-gradient-*`,
8
8
  * `.card-*`, `.callout-*` and `.direct-chat-*` families — with dark mode.
9
- * Every colour takes white text at ≥ 4.6:1. See docs/colors.html.
9
+ * `data-lte-primary="teal"` on <html> also makes that colour Bootstrap's
10
+ * `primary`, buttons and all. Every colour takes white text at ≥ 4.6:1.
11
+ * See docs/colors.html.
10
12
  *
11
13
  * Author: Colorlib
12
14
  * Website: AdminLTE.io <https://adminlte.io>
@@ -33,3 +35,4 @@
33
35
  // ---------------------------------------------------
34
36
  @import "colors/variables";
35
37
  @import "colors/colors";
38
+ @import "colors/primary";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 — documentation styles
2
+ * AdminLTE v4.8.1 — documentation styles
3
3
  * Styles for the documentation and FAQ pages only (body.docs-page /
4
4
  * body.faq-page). Applications never need this file; it is loaded by the
5
5
  * docs pages in addition to adminlte.css.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1 — Select2 compatibility theme
2
+ * AdminLTE v4.8.1 — Select2 compatibility theme
3
3
  * Styling only. AdminLTE bundles neither Select2 nor jQuery; this optional
4
4
  * sheet makes a Select2 you load yourself match Bootstrap 5.3 form controls,
5
5
  * including `data-bs-theme` dark mode. Load it AFTER select2.css.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * AdminLTE v4.4.1
2
+ * AdminLTE v4.8.1
3
3
  * Author: Colorlib
4
4
  * Website: AdminLTE.io <https://adminlte.io>
5
5
  * License: Open source - MIT <https://opensource.org/licenses/MIT>
@@ -18,18 +18,18 @@
18
18
  @each $name, $value in $lte-palette {
19
19
  --#{$prefix}#{$name}: #{$value};
20
20
  --#{$prefix}#{$name}-rgb: #{to-rgb($value)};
21
- --#{$prefix}#{$name}-text-emphasis: #{shade-color($value, 60%)};
22
- --#{$prefix}#{$name}-bg-subtle: #{tint-color($value, 80%)};
23
- --#{$prefix}#{$name}-border-subtle: #{tint-color($value, 60%)};
21
+ --#{$prefix}#{$name}-text-emphasis: #{lte-hex(shade-color($value, 60%))};
22
+ --#{$prefix}#{$name}-bg-subtle: #{lte-hex(tint-color($value, 80%))};
23
+ --#{$prefix}#{$name}-border-subtle: #{lte-hex(tint-color($value, 60%))};
24
24
  }
25
25
  }
26
26
 
27
27
  @if $enable-dark-mode {
28
28
  @include color-mode(dark, true) {
29
29
  @each $name, $value in $lte-palette {
30
- --#{$prefix}#{$name}-text-emphasis: #{tint-color($value, 40%)};
31
- --#{$prefix}#{$name}-bg-subtle: #{shade-color($value, 80%)};
32
- --#{$prefix}#{$name}-border-subtle: #{shade-color($value, 40%)};
30
+ --#{$prefix}#{$name}-text-emphasis: #{lte-hex(tint-color($value, 40%))};
31
+ --#{$prefix}#{$name}-bg-subtle: #{lte-hex(shade-color($value, 80%))};
32
+ --#{$prefix}#{$name}-border-subtle: #{lte-hex(shade-color($value, 40%))};
33
33
  }
34
34
  }
35
35
  }
@@ -127,12 +127,46 @@
127
127
  .btn.bg-gradient-#{$name} {
128
128
  &:hover,
129
129
  &:focus-visible {
130
- background-color: #{shade-color($value, 10%)} !important;
130
+ background-color: #{lte-hex(shade-color($value, 10%))} !important;
131
131
  }
132
132
 
133
133
  &:active,
134
134
  &.active {
135
- background-color: #{shade-color($value, 15%)} !important;
135
+ background-color: #{lte-hex(shade-color($value, 15%))} !important;
136
+ }
137
+ }
138
+ }
139
+
140
+ // `data-lte-contrast="aa"`
141
+ // --------------------------------------------------------
142
+ // Opt in to WCAG AA text on the backgrounds where this palette's own rule falls
143
+ // short. Backgrounds are untouched — every colour keeps its exact value — only
144
+ // the text on top of them flips. Emitted per colour only where the two rules
145
+ // disagree, so the designed palette (every colour AA with white) adds nothing
146
+ // here and the v3 sheet carries the eight that need it (#6110).
147
+ //
148
+ // A coloured sidebar or header carrying a flipped colour should also pair with
149
+ // `data-bs-theme="light"` instead of `"dark"`, so its nav links follow the text.
150
+ [data-lte-contrast="aa"] {
151
+ @each $name, $value in $lte-palette {
152
+ $aa: lte-contrast-aa($value);
153
+
154
+ @if lte-needs-aa($value) {
155
+ .text-bg-#{$name},
156
+ .bg-gradient-#{$name} {
157
+ color: $aa !important;
158
+ }
159
+
160
+ .card-#{$name},
161
+ .bg-#{$name},
162
+ .text-bg-#{$name} {
163
+ --#{$lte-prefix}card-variant-color: #{$aa};
164
+ --#{$lte-prefix}card-variant-color-rgb: #{to-rgb($aa)};
165
+ }
166
+
167
+ .direct-chat-#{$name} {
168
+ --#{$lte-prefix}direct-chat-color: #{$aa};
169
+ }
136
170
  }
137
171
  }
138
172
  }
@@ -0,0 +1,276 @@
1
+ @use "sass:map";
2
+
3
+ //
4
+ // Colors: `primary` as a theme colour
5
+ // --------------------------------------------------------
6
+ // Bootstrap bakes `$primary` into components at build time — `.btn-primary`
7
+ // carries `--bs-btn-bg: #0d6efd`, not `var(--bs-primary)` — so overriding
8
+ // `--bs-primary` alone repaints utilities and leaves buttons blue.
9
+ //
10
+ // This block rewires those components to variables, then points the variables
11
+ // at a palette colour per `data-lte-primary` value:
12
+ //
13
+ // <html lang="en" data-lte-primary="teal">
14
+ //
15
+ // Nothing applies without the attribute, and it works on any container, so a
16
+ // section of a page can carry its own primary. Requested in #6107.
17
+ //
18
+
19
+ // Which way a state moves: Bootstrap darkens a colour that carries white text
20
+ // and lightens one that carries dark text (see its button-variant mixin).
21
+ @function lte-primary-state($color, $shade, $tint, $text) {
22
+ @if $text == $color-contrast-light or $text == $lte-palette-yiq-text-light {
23
+ @return lte-hex(shade-color($color, $shade));
24
+ }
25
+
26
+ @return lte-hex(tint-color($color, $tint));
27
+ }
28
+
29
+ // Defaults, so `data-lte-primary` also works with a hand-written
30
+ // `--bs-primary` (a brand colour that is not in the palette).
31
+ [data-lte-primary] {
32
+ --#{$prefix}focus-ring-color: rgba(var(--#{$prefix}primary-rgb), #{$focus-ring-opacity});
33
+ --#{$lte-prefix}primary-color: #{$color-contrast-light};
34
+ --#{$lte-prefix}primary-color-rgb: #{to-rgb($color-contrast-light)};
35
+ --#{$lte-prefix}primary-hover: var(--#{$prefix}primary);
36
+ --#{$lte-prefix}primary-hover-border: var(--#{$prefix}primary);
37
+ --#{$lte-prefix}primary-active: var(--#{$prefix}primary);
38
+ --#{$lte-prefix}primary-active-border: var(--#{$prefix}primary);
39
+ }
40
+
41
+ // Shade the hover / active states of a hand-written colour where the browser
42
+ // can do the maths. Guarded: without the guard, older browsers would resolve
43
+ // the variable to nothing and paint a transparent button.
44
+ @supports (color: color-mix(in srgb, red 50%, black)) {
45
+ [data-lte-primary] {
46
+ --#{$lte-prefix}primary-hover: color-mix(in srgb, var(--#{$prefix}primary) 85%, #{$black});
47
+ --#{$lte-prefix}primary-hover-border: color-mix(in srgb, var(--#{$prefix}primary) 80%, #{$black});
48
+ --#{$lte-prefix}primary-active: color-mix(in srgb, var(--#{$prefix}primary) 80%, #{$black});
49
+ --#{$lte-prefix}primary-active-border: color-mix(in srgb, var(--#{$prefix}primary) 75%, #{$black});
50
+ }
51
+ }
52
+
53
+ // The presets: every palette colour, plus Bootstrap's own theme colours, so
54
+ // `data-lte-primary="danger"` works without the palette being involved. The
55
+ // tokens are aliases — dark mode is already handled where they are defined.
56
+ @each $name, $value in map.merge($theme-colors, $lte-palette) {
57
+ @if $name != "primary" {
58
+ $link-hover: shift-color($value, $link-shade-percentage);
59
+ // Palette colours follow this sheet's contrast rule; Bootstrap's own theme
60
+ // colours keep Bootstrap's, so `data-lte-primary="info"` agrees with
61
+ // `.btn-info` and `.text-bg-info` on the same page rather than taking the
62
+ // v3 YIQ rule's white text on cyan (1.96:1).
63
+ $text: if(map.has-key($lte-palette, $name), lte-contrast($value), color-contrast($value));
64
+
65
+ [data-lte-primary="#{$name}"] {
66
+ --#{$prefix}primary: var(--#{$prefix}#{$name});
67
+ --#{$prefix}primary-rgb: var(--#{$prefix}#{$name}-rgb);
68
+ --#{$prefix}primary-text-emphasis: var(--#{$prefix}#{$name}-text-emphasis);
69
+ --#{$prefix}primary-bg-subtle: var(--#{$prefix}#{$name}-bg-subtle);
70
+ --#{$prefix}primary-border-subtle: var(--#{$prefix}#{$name}-border-subtle);
71
+ --#{$prefix}link-color: var(--#{$prefix}#{$name});
72
+ --#{$prefix}link-color-rgb: var(--#{$prefix}#{$name}-rgb);
73
+ --#{$prefix}link-hover-color: #{lte-hex($link-hover)};
74
+ --#{$prefix}link-hover-color-rgb: #{to-rgb($link-hover)};
75
+ --#{$lte-prefix}primary-hover: #{lte-primary-state($value, $btn-hover-bg-shade-amount, $btn-hover-bg-tint-amount, $text)};
76
+ --#{$lte-prefix}primary-hover-border: #{lte-primary-state($value, $btn-hover-border-shade-amount, $btn-hover-border-tint-amount, $text)};
77
+ --#{$lte-prefix}primary-active: #{lte-primary-state($value, $btn-active-bg-shade-amount, $btn-active-bg-tint-amount, $text)};
78
+ --#{$lte-prefix}primary-active-border: #{lte-primary-state($value, $btn-active-border-shade-amount, $btn-active-border-tint-amount, $text)};
79
+
80
+ // The shared block above already says white; only the light colours,
81
+ // which carry dark text, need to say otherwise
82
+ @if $text != $color-contrast-light {
83
+ --#{$lte-prefix}primary-color: #{$text};
84
+ --#{$lte-prefix}primary-color-rgb: #{to-rgb($text)};
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ // Links carry Bootstrap's dark-mode tint, as they do for the default primary.
91
+ @if $enable-dark-mode {
92
+ @include color-mode(dark, true) {
93
+ @each $name, $value in map.merge($theme-colors, $lte-palette) {
94
+ @if $name != "primary" {
95
+ $link-dark: tint-color($value, 40%);
96
+ $link-dark-hover: tint-color($link-dark, 20%);
97
+
98
+ // Both selectors: `data-bs-theme` and `data-lte-primary` usually sit on
99
+ // the same <html> element, which a descendant combinator would miss.
100
+ &[data-lte-primary="#{$name}"],
101
+ [data-lte-primary="#{$name}"] {
102
+ --#{$prefix}link-color: #{lte-hex($link-dark)};
103
+ --#{$prefix}link-color-rgb: #{to-rgb($link-dark)};
104
+ --#{$prefix}link-hover-color: #{lte-hex($link-dark-hover)};
105
+ --#{$prefix}link-hover-color-rgb: #{to-rgb($link-dark-hover)};
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ // `data-lte-contrast="aa"` for the primary text colour, same rule as the
113
+ // utilities: flip only where the palette's own pick misses AA (#6110).
114
+ @each $name, $value in map.merge($theme-colors, $lte-palette) {
115
+ @if $name != "primary" {
116
+ $aa: lte-contrast-aa($value);
117
+ $text: if(map.has-key($lte-palette, $name), lte-contrast($value), color-contrast($value));
118
+
119
+ @if lte-needs-aa($value, $text) {
120
+ // `data-lte-contrast` and `data-lte-primary` are usually the same element
121
+ [data-lte-contrast="aa"][data-lte-primary="#{$name}"],
122
+ [data-lte-contrast="aa"] [data-lte-primary="#{$name}"] {
123
+ --#{$lte-prefix}primary-color: #{$aa};
124
+ --#{$lte-prefix}primary-color-rgb: #{to-rgb($aa)};
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ // The components that bake the colour
131
+ // --------------------------------------------------------
132
+ // Deliberately a second `[data-lte-primary]` block: the variable defaults above
133
+ // have to be declared before the per-colour presets (same specificity), and the
134
+ // component rules have to come after them.
135
+ /* stylelint-disable-next-line no-duplicate-selectors */
136
+ [data-lte-primary] {
137
+ .btn-primary {
138
+ --#{$prefix}btn-color: var(--#{$lte-prefix}primary-color);
139
+ --#{$prefix}btn-bg: var(--#{$prefix}primary);
140
+ --#{$prefix}btn-border-color: var(--#{$prefix}primary);
141
+ --#{$prefix}btn-hover-color: var(--#{$lte-prefix}primary-color);
142
+ --#{$prefix}btn-hover-bg: var(--#{$lte-prefix}primary-hover);
143
+ --#{$prefix}btn-hover-border-color: var(--#{$lte-prefix}primary-hover-border);
144
+ --#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}primary-rgb);
145
+ --#{$prefix}btn-active-color: var(--#{$lte-prefix}primary-color);
146
+ --#{$prefix}btn-active-bg: var(--#{$lte-prefix}primary-active);
147
+ --#{$prefix}btn-active-border-color: var(--#{$lte-prefix}primary-active-border);
148
+ --#{$prefix}btn-disabled-color: var(--#{$lte-prefix}primary-color);
149
+ --#{$prefix}btn-disabled-bg: var(--#{$prefix}primary);
150
+ --#{$prefix}btn-disabled-border-color: var(--#{$prefix}primary);
151
+ }
152
+
153
+ .btn-outline-primary {
154
+ --#{$prefix}btn-color: var(--#{$prefix}primary);
155
+ --#{$prefix}btn-border-color: var(--#{$prefix}primary);
156
+ --#{$prefix}btn-hover-color: var(--#{$lte-prefix}primary-color);
157
+ --#{$prefix}btn-hover-bg: var(--#{$prefix}primary);
158
+ --#{$prefix}btn-hover-border-color: var(--#{$prefix}primary);
159
+ --#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}primary-rgb);
160
+ --#{$prefix}btn-active-color: var(--#{$lte-prefix}primary-color);
161
+ --#{$prefix}btn-active-bg: var(--#{$prefix}primary);
162
+ --#{$prefix}btn-active-border-color: var(--#{$prefix}primary);
163
+ --#{$prefix}btn-disabled-color: var(--#{$prefix}primary);
164
+ --#{$prefix}btn-disabled-border-color: var(--#{$prefix}primary);
165
+ }
166
+
167
+ .btn-link {
168
+ --#{$prefix}btn-focus-shadow-rgb: var(--#{$prefix}primary-rgb);
169
+ }
170
+
171
+ // `.text-bg-primary` hard-codes white; the rest of it already reads the token
172
+ .text-bg-primary {
173
+ color: var(--#{$lte-prefix}primary-color) !important;
174
+ }
175
+
176
+ .link-primary {
177
+ &:hover,
178
+ &:focus {
179
+ color: RGBA(var(--#{$prefix}link-hover-color-rgb), var(--#{$prefix}link-opacity, 1)) !important;
180
+ text-decoration-color: RGBA(var(--#{$prefix}link-hover-color-rgb), var(--#{$prefix}link-underline-opacity, 1)) !important;
181
+ }
182
+ }
183
+
184
+ .dropdown-menu {
185
+ --#{$prefix}dropdown-link-active-color: var(--#{$lte-prefix}primary-color);
186
+ --#{$prefix}dropdown-link-active-bg: var(--#{$prefix}primary);
187
+ }
188
+
189
+ .nav-pills {
190
+ --#{$prefix}nav-pills-link-active-color: var(--#{$lte-prefix}primary-color);
191
+ --#{$prefix}nav-pills-link-active-bg: var(--#{$prefix}primary);
192
+ }
193
+
194
+ .pagination {
195
+ --#{$prefix}pagination-active-color: var(--#{$lte-prefix}primary-color);
196
+ --#{$prefix}pagination-active-bg: var(--#{$prefix}primary);
197
+ --#{$prefix}pagination-active-border-color: var(--#{$prefix}primary);
198
+ // Sass does not evaluate `$variables` inside a custom property value — it
199
+ // emits them verbatim — so every part of this has to be interpolated or a
200
+ // `var()`. Reuses the focus-ring token set on `[data-lte-primary]` above.
201
+ --#{$prefix}pagination-focus-box-shadow: 0 0 #{$focus-ring-blur} #{$focus-ring-width} var(--#{$prefix}focus-ring-color);
202
+ }
203
+
204
+ .progress,
205
+ .progress-stacked {
206
+ --#{$prefix}progress-bar-color: var(--#{$lte-prefix}primary-color);
207
+ --#{$prefix}progress-bar-bg: var(--#{$prefix}primary);
208
+ }
209
+
210
+ .list-group {
211
+ --#{$prefix}list-group-active-color: var(--#{$lte-prefix}primary-color);
212
+ --#{$prefix}list-group-active-bg: var(--#{$prefix}primary);
213
+ --#{$prefix}list-group-active-border-color: var(--#{$prefix}primary);
214
+ }
215
+
216
+ // The open-state chevron is a data URI in Bootstrap's blue; the closed one is
217
+ // body-coloured and rotates just the same
218
+ .accordion {
219
+ --#{$prefix}accordion-btn-active-icon: var(--#{$prefix}accordion-btn-icon);
220
+ }
221
+
222
+ // Forms
223
+ .form-control:focus,
224
+ .form-select:focus {
225
+ border-color: var(--#{$prefix}primary);
226
+ box-shadow: var(--#{$prefix}box-shadow-inset), 0 0 0 $input-btn-focus-width rgba(var(--#{$prefix}primary-rgb), #{$focus-ring-opacity});
227
+ }
228
+
229
+ .form-check-input:focus {
230
+ border-color: var(--#{$prefix}primary);
231
+ box-shadow: 0 0 0 $input-btn-focus-width rgba(var(--#{$prefix}primary-rgb), #{$focus-ring-opacity});
232
+ }
233
+
234
+ .form-check-input:checked,
235
+ .form-check-input[type="checkbox"]:indeterminate {
236
+ background-color: var(--#{$prefix}primary);
237
+ border-color: var(--#{$prefix}primary);
238
+ }
239
+
240
+ // Focus paints a blue knob into a data URI; keep the resting one instead
241
+ .form-switch .form-check-input:focus:not(:checked) {
242
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image)};
243
+ }
244
+
245
+ .form-range {
246
+ &::-webkit-slider-thumb {
247
+ background-color: var(--#{$prefix}primary);
248
+ }
249
+
250
+ &::-moz-range-thumb {
251
+ background-color: var(--#{$prefix}primary);
252
+ }
253
+ }
254
+
255
+ // AdminLTE's own primary hooks
256
+ .card-primary,
257
+ .bg-primary,
258
+ .text-bg-primary {
259
+ --#{$lte-prefix}card-variant-bg: var(--#{$prefix}primary);
260
+ --#{$lte-prefix}card-variant-bg-rgb: var(--#{$prefix}primary-rgb);
261
+ --#{$lte-prefix}card-variant-color: var(--#{$lte-prefix}primary-color);
262
+ --#{$lte-prefix}card-variant-color-rgb: var(--#{$lte-prefix}primary-color-rgb);
263
+ }
264
+
265
+ .direct-chat-primary {
266
+ --#{$lte-prefix}direct-chat-color: var(--#{$lte-prefix}primary-color);
267
+ --#{$lte-prefix}direct-chat-bg: var(--#{$prefix}primary);
268
+ }
269
+
270
+ .toast-primary {
271
+ --#{$prefix}toast-header-color: var(--#{$lte-prefix}primary-color);
272
+ --#{$prefix}toast-header-bg: var(--#{$prefix}primary);
273
+ --#{$prefix}toast-header-border-color: var(--#{$prefix}primary);
274
+ --#{$prefix}toast-border-color: var(--#{$prefix}primary);
275
+ }
276
+ }
@@ -1,5 +1,8 @@
1
+ @use "sass:color";
1
2
  @use "sass:list";
2
3
  @use "sass:map";
4
+ @use "sass:math";
5
+ @use "sass:string";
3
6
 
4
7
  //
5
8
  // Colors: Variables
@@ -67,6 +70,16 @@ $lte-palette-aliases: () !default;
67
70
  // palettes — `3` is WCAG AA for large text and UI components.
68
71
  $lte-palette-min-contrast-ratio: $min-contrast-ratio !default;
69
72
 
73
+ // Which rule picks that text colour: "wcag" (Bootstrap 5's color-contrast(),
74
+ // governed by the ratio above) or "yiq" — the Bootstrap 4 / AdminLTE 3 rule
75
+ // (perceived brightness against a threshold), which is what gives the v3
76
+ // palette its familiar white-on-lightblue / white-on-teal look.
77
+ // adminlte-colors-v3.scss sets "yiq"; the designed palette uses "wcag".
78
+ $lte-palette-contrast: "wcag" !default;
79
+ $lte-palette-yiq-threshold: 150 !default;
80
+ $lte-palette-yiq-text-dark: #1f2d3d !default; // AdminLTE 3's $yiq-text-dark
81
+ $lte-palette-yiq-text-light: $white !default;
82
+
70
83
  // Resolve custom colours and aliases into the palette
71
84
  // --------------------------------------------------------
72
85
  @if list.length($lte-palette-custom) > 0 {
@@ -80,6 +93,58 @@ $lte-palette-min-contrast-ratio: $min-contrast-ratio !default;
80
93
  $lte-palette: map.merge($lte-palette, ($alias: map.get($lte-palette, $target)));
81
94
  }
82
95
 
96
+ // Serialise a computed colour as `#0e6864`. Dart Sass writes `rgb(14, 104, 100)`
97
+ // (or worse, `rgb(5.647%, 40.784%, 39.216%)`) and cleancss leaves values inside
98
+ // custom properties alone, so the long form would ship as-is — this is the same
99
+ // colour at a third of the bytes.
100
+ @function lte-hex-channel($value) {
101
+ $digits: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f";
102
+ $n: math.clamp(0, math.round($value), 255);
103
+ @return list.nth($digits, math.floor(math.div($n, 16)) + 1) + list.nth($digits, $n % 16 + 1);
104
+ }
105
+
106
+ @function lte-hex($color) {
107
+ // stylelint-disable scss/at-function-named-arguments -- `$space` is required by color.channel()
108
+ $r: color.channel($color, "red", $space: rgb);
109
+ $g: color.channel($color, "green", $space: rgb);
110
+ $b: color.channel($color, "blue", $space: rgb);
111
+ // stylelint-enable scss/at-function-named-arguments
112
+
113
+ @return string.unquote("##{lte-hex-channel($r)}#{lte-hex-channel($g)}#{lte-hex-channel($b)}");
114
+ }
115
+
116
+ // The text colour WCAG AA needs on this background, whatever rule the sheet
117
+ // itself uses. Bootstrap's `color-contrast()` keeps white where white clears the
118
+ // ratio and returns black where it does not — note that AdminLTE 3's own dark
119
+ // ink (#1f2d3d) is NOT enough here: it reaches 4.5:1 on only two of the eight
120
+ // v3 colours that fall short (#6110).
121
+ @function lte-contrast-aa($color) {
122
+ @return color-contrast($color, $min-contrast-ratio: 4.5);
123
+ }
124
+
125
+ // True only when the text colour this sheet assigns actually falls short. The
126
+ // test is the ratio, not "is it a different colour": v3 writes dark text as
127
+ // #1f2d3d, which clears AA on lime, orange and yellow — those must not flip
128
+ // just because AA's dark ink is pure black.
129
+ @function lte-needs-aa($color, $text: null) {
130
+ $on: if($text == null, lte-contrast($color), $text);
131
+ @return contrast-ratio($color, $on) < 4.5;
132
+ }
133
+
83
134
  @function lte-contrast($color) {
135
+ @if $lte-palette-contrast == "yiq" {
136
+ // stylelint-disable scss/at-function-named-arguments -- `$space` is required by color.channel()
137
+ $r: color.channel($color, "red", $space: rgb);
138
+ $g: color.channel($color, "green", $space: rgb);
139
+ $b: color.channel($color, "blue", $space: rgb);
140
+ // stylelint-enable scss/at-function-named-arguments
141
+ $yiq: math.div($r * 299 + $g * 587 + $b * 114, 1000);
142
+ @if $yiq >= $lte-palette-yiq-threshold {
143
+ @return $lte-palette-yiq-text-dark;
144
+ }
145
+
146
+ @return $lte-palette-yiq-text-light;
147
+ }
148
+
84
149
  @return color-contrast($color, $min-contrast-ratio: $lte-palette-min-contrast-ratio);
85
150
  }
@@ -10,7 +10,7 @@ import SidebarSearch from './sidebar-search.js'
10
10
  import { initAccessibility } from './accessibility.js'
11
11
 
12
12
  /**
13
- * AdminLTE v4.4.1
13
+ * AdminLTE v4.8.1
14
14
  * Author: Colorlib
15
15
  * Website: AdminLTE.io <https://adminlte.io>
16
16
  * License: Open source - MIT <https://opensource.org/licenses/MIT>