jekyll-theme-zer0 1.31.2 → 1.32.0

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +183 -0
  3. data/_data/ai.yml +1 -1
  4. data/_data/backlog.yml +149 -28
  5. data/_data/features.yml +173 -17
  6. data/_data/navigation/admin.yml +26 -8
  7. data/_data/navigation/docs.yml +2 -8
  8. data/_data/site_builder.yml +1 -1
  9. data/_data/theme-manifest.yml +74 -58
  10. data/_data/ui-text.yml +9 -0
  11. data/_includes/README.md +2 -1
  12. data/_includes/analytics/google-analytics.html +46 -9
  13. data/_includes/analytics/posthog.html +101 -77
  14. data/_includes/components/ai-chat.html +3 -3
  15. data/_includes/components/author-bio.html +3 -1
  16. data/_includes/components/author-card.html +9 -9
  17. data/_includes/components/author-eeat.html +13 -3
  18. data/_includes/components/collection-manager.html +2 -2
  19. data/_includes/components/component-showcase.html +7 -7
  20. data/_includes/components/cookie-consent-needed.html +37 -0
  21. data/_includes/components/cookie-consent.html +44 -5
  22. data/_includes/components/page-feedback.html +10 -6
  23. data/_includes/components/post-card.html +2 -2
  24. data/_includes/components/theme-customizer.html +1 -1
  25. data/_includes/content/comments.html +46 -0
  26. data/_includes/content/giscus.html +22 -13
  27. data/_includes/content/intro.html +39 -3
  28. data/_includes/content/jsonld-software.html +4 -9
  29. data/_includes/content/sitemap.html +173 -17
  30. data/_includes/core/favicon.html +42 -6
  31. data/_includes/core/footer.html +38 -17
  32. data/_includes/core/header.html +11 -2
  33. data/_includes/navigation/admin-nav.html +110 -63
  34. data/_includes/navigation/section-sidebar.html +20 -20
  35. data/_includes/navigation/sidebar-config.html +17 -8
  36. data/_includes/navigation/sidebar-right.html +16 -2
  37. data/_includes/setup/wizard.html +2 -2
  38. data/_layouts/README.md +1 -1
  39. data/_layouts/admin.html +49 -20
  40. data/_layouts/article.html +10 -10
  41. data/_layouts/book-story.html +3 -7
  42. data/_layouts/default.html +63 -2
  43. data/_layouts/news.html +8 -7
  44. data/_layouts/note.html +2 -6
  45. data/_layouts/notebook.html +2 -6
  46. data/_layouts/recipe.html +3 -7
  47. data/_layouts/root.html +7 -4
  48. data/_layouts/section.html +43 -42
  49. data/_sass/components/_back-to-top.scss +9 -0
  50. data/_sass/components/_cookie-banner.scss +31 -0
  51. data/_sass/components/_page-feedback.scss +1 -1
  52. data/_sass/components/_ui-enhancements.scss +22 -0
  53. data/_sass/core/_nav-tree.scss +10 -2
  54. data/_sass/core/_navbar.scss +19 -5
  55. data/_sass/core/_obsidian.scss +19 -3
  56. data/_sass/core/_sidebar-categories.scss +4 -2
  57. data/_sass/core/_sidebar-extras.scss +3 -2
  58. data/_sass/layouts/_admin.scss +60 -0
  59. data/_sass/layouts/_navbar-extras.scss +7 -2
  60. data/_sass/theme/_skins.scss +124 -32
  61. data/_sass/tokens/_color.scss +3 -0
  62. data/_sass/tokens/_layers.scss +12 -5
  63. data/_sass/utilities/_focus.scss +12 -1
  64. data/assets/css/main.scss +1 -0
  65. data/assets/js/code-copy.js +30 -2
  66. data/assets/js/modules/navigation/index.js +94 -40
  67. data/assets/js/modules/navigation/scroll-spy.js +70 -7
  68. data/assets/js/setup-wizard.js +2 -2
  69. data/assets/js/ui-enhancements.js +46 -0
  70. data/scripts/ai/README.md +1 -1
  71. data/scripts/ai/api_call.rb +1 -1
  72. data/scripts/bin/audit-consumer +155 -8
  73. data/scripts/bin/manifest +27 -8
  74. data/scripts/bin/validate +3 -2
  75. data/scripts/ci/test_visual_evidence_autogen.py +53 -1
  76. data/scripts/ci/visual_evidence_autogen.py +26 -7
  77. data/scripts/install/ai/client.sh +1 -1
  78. data/scripts/lib/audit.sh +156 -0
  79. data/scripts/lib/preview_generator.py +1 -1
  80. data/scripts/translate.rb +1 -1
  81. data/scripts/validate-features.rb +20 -2
  82. metadata +5 -2
@@ -751,8 +751,14 @@
751
751
  // Enhanced visual feedback for current page
752
752
  // -----------------------------------------------------------------------------
753
753
 
754
+ // The current page's link takes the skin's strong link shade, not the raw
755
+ // brand: #6fa8dc on the #f8f9fa navbar was 2.40:1 for the default air skin
756
+ // (#410, and the site-quality scans of every site on this theme).
757
+ // --bs-link-hover-color is darker than the link in light mode and lighter in
758
+ // dark mode, so it clears 4.5:1 on the navbar for every skin, including the
759
+ // two that keep Bootstrap's #0d6efd (4.27:1 there). The underline follows it.
754
760
  .nav-link[aria-current="page"] {
755
- color: var(--bs-primary);
761
+ color: var(--bs-link-hover-color);
756
762
  font-weight: 600;
757
763
  position: relative;
758
764
 
@@ -764,20 +770,26 @@
764
770
  transform: translateX(-50%);
765
771
  width: 60%;
766
772
  height: 2px;
767
- background-color: var(--bs-primary);
773
+ background-color: currentColor;
768
774
  border-radius: 2px;
769
775
  }
770
776
  }
771
777
 
778
+ // A brand-filled row, so its text is the skin's on-brand ink (white was
779
+ // 2.53:1 on air). #bdNavbar keeps the fill and ink on hover: the
780
+ // `.nav-hover-dropdown .dropdown-item:hover` tint below and the skins' link
781
+ // hover colour would otherwise repaint it.
772
782
  .dropdown-item[aria-current="page"] {
773
783
  background-color: var(--bs-primary);
774
- color: var(--bs-white);
784
+ color: var(--zer0-color-on-primary, var(--bs-white));
775
785
  font-weight: 500;
776
786
  border-radius: 0.375rem;
777
787
  }
778
788
 
779
- .dropdown-item[aria-current="page"]:hover {
789
+ .dropdown-item[aria-current="page"]:hover,
790
+ #bdNavbar .dropdown-item[aria-current="page"]:hover {
780
791
  background-color: var(--bs-primary);
792
+ color: var(--zer0-color-on-primary, var(--bs-white));
781
793
  filter: brightness(0.95);
782
794
  }
783
795
 
@@ -890,8 +902,10 @@
890
902
  border-bottom-color: var(--bs-primary-bg-subtle);
891
903
  }
892
904
 
905
+ // Selected tab: the strong link shade (see the current-page link above);
906
+ // the underline keeps the brand.
893
907
  &.active {
894
- color: var(--bs-primary);
908
+ color: var(--bs-link-hover-color);
895
909
  border-bottom-color: var(--bs-primary);
896
910
  background: transparent;
897
911
  }
@@ -489,9 +489,13 @@
489
489
  // see _sass/theme/_backgrounds.scss), but the id keeps the FAB immune to any
490
490
  // future generic child rule. Mirrors `#aiChatToggle`. See ai-chat.html.
491
491
  //
492
- // Slot 2 on the left-side FAB stack: sits above the page-feedback FAB
493
- // (slot 1 = var(--zer0-space-fab-offset)) — same stacking formula as
494
- // .bd-toc-fab above #backToTopBtn on the right side.
492
+ // Left-side FAB stack (bottom → top):
493
+ // slot 1 #pageFeedbackFab always
494
+ // slot 2 #sidebarFab <lg only (d-lg-none), when the docs sidebar renders
495
+ // slot 2 #obsidianLocalGraphFab at lg+, or <lg on a page without #sidebarFab
496
+ // slot 3 #obsidianLocalGraphFab <lg when #sidebarFab is present (#571)
497
+ // Slot n sits at offset + (n - 1) * (size + gap) — the same stacking formula
498
+ // as .bd-toc-fab above #backToTopBtn on the right side.
495
499
  #obsidianLocalGraphFab.obsidian-local-graph-fab {
496
500
  position: fixed;
497
501
  left: var(--zer0-space-fab-offset, 1rem);
@@ -508,6 +512,18 @@
508
512
  }
509
513
  }
510
514
 
515
+ // Below lg the docs-sidebar FAB claims slot 2, so the graph FAB moves up to
516
+ // slot 3. Without this the two boxes were identical and the graph FAB (higher
517
+ // z-index) swallowed every tap meant for the sidebar FAB (#571).
518
+ @media (max-width: 991.98px) {
519
+ body:has(#sidebarFab) #obsidianLocalGraphFab.obsidian-local-graph-fab {
520
+ bottom: calc(
521
+ var(--zer0-space-fab-offset, 1rem) +
522
+ 2 * (var(--zer0-space-fab-size, 3.5rem) + var(--zer0-space-fab-gap, 0.75rem))
523
+ );
524
+ }
525
+ }
526
+
511
527
  .btn.obsidian-local-graph-toggle {
512
528
  --bs-btn-padding-x: 0;
513
529
  --bs-btn-padding-y: 0;
@@ -54,9 +54,11 @@
54
54
  box-shadow: none;
55
55
  }
56
56
 
57
+ // Open category: text in the strong link shade, not the brand (air was
58
+ // about 2.3:1 on this tint); the accent bar keeps the brand.
57
59
  &:not(.collapsed),
58
60
  &[aria-expanded="true"] {
59
- color: var(--zer0-color-primary);
61
+ color: var(--zer0-color-link-hover);
60
62
  background-color: color-mix(in srgb, var(--zer0-color-primary) 10%, var(--zer0-color-bg-elevated));
61
63
  border-left-color: var(--zer0-color-primary);
62
64
  }
@@ -99,7 +101,7 @@
99
101
  }
100
102
 
101
103
  &.active {
102
- color: var(--zer0-color-primary);
104
+ color: var(--zer0-color-link-hover);
103
105
  font-weight: var(--zer0-font-weight-medium);
104
106
  }
105
107
 
@@ -32,11 +32,12 @@
32
32
 
33
33
  // Smooth scroll behavior is declared once below (see "Smooth Scroll Enhancement")
34
34
 
35
- // Category sidebar active state (nav-tree--categories)
35
+ // Category sidebar active state (nav-tree--categories). Text in the strong
36
+ // link shade: the brand on its own 10% tint failed 4.5:1 on the light skins.
36
37
  .nav-tree--categories .sidebar-categories-link.active {
37
38
  font-weight: var(--zer0-font-weight-medium);
38
39
  background-color: color-mix(in srgb, var(--zer0-color-primary) 10%, transparent);
39
- color: var(--zer0-color-primary);
40
+ color: var(--zer0-color-link-hover);
40
41
  }
41
42
 
42
43
  // Improve sidebar link hover states
@@ -0,0 +1,60 @@
1
+ // Feature: ZER0-050
2
+ // ============================================================================
3
+ // Admin layout (settings and configuration pages)
4
+ // ----------------------------------------------------------------------------
5
+ // _layouts/admin.html + _includes/navigation/admin-nav.html
6
+ // Data: _data/navigation/admin.yml (`group:` drives the sidebar sections)
7
+ // ============================================================================
8
+
9
+ // Header title block. A 10rem basis lets it share the row with the actions
10
+ // from md up; below that the actions wrap onto their own line instead of
11
+ // pushing the row wider than a phone screen.
12
+ .admin-header-title {
13
+ flex: 1 1 10rem;
14
+ }
15
+
16
+ // Sidebar nav. The active item is a tint of the skin's primary
17
+ // (--zer0-color-primary, set per [data-theme-skin]) under the body-emphasis
18
+ // text colour, semibold via the markup's .fw-semibold, instead of Bootstrap's
19
+ // solid --bs-primary pill. Skin link colours sit at about 4.5:1 on the plain
20
+ // body background (Bootstrap's #0d6efd is 4.50:1 on white), so link-coloured
21
+ // text on any tint would drop below WCAG AA; the emphasis colour keeps the
22
+ // active label readable on every skin, in light and dark mode.
23
+ .nav-pills.admin-nav {
24
+ --bs-nav-pills-link-active-bg: color-mix(in srgb, var(--zer0-color-primary) 14%, transparent);
25
+ --bs-nav-pills-link-active-color: var(--bs-emphasis-color);
26
+ gap: .75rem;
27
+ }
28
+
29
+ // Small-caps section label (Configure / System / Links). Plain text, not a
30
+ // heading, so the page outline stays h1 → content; the nested list it heads
31
+ // takes its accessible name from it (aria-labelledby).
32
+ .admin-nav-group-label {
33
+ display: block;
34
+ padding: 0 var(--bs-nav-link-padding-x, 1rem) .25rem;
35
+ font-size: .75rem;
36
+ font-weight: 600;
37
+ letter-spacing: .06em;
38
+ text-transform: uppercase;
39
+ color: var(--bs-secondary-color);
40
+ }
41
+
42
+ // Trailing count or status: a plain numeral, or a coloured dot plus a word.
43
+ // Regular weight even on the semibold active item, so the label leads.
44
+ .admin-nav-meta {
45
+ padding-left: .5rem;
46
+ font-size: .75rem;
47
+ font-weight: 400;
48
+ font-variant-numeric: tabular-nums;
49
+ color: var(--bs-secondary-color);
50
+ white-space: nowrap;
51
+ }
52
+
53
+ // The dot is decorative (aria-hidden): the word next to it carries the state.
54
+ .admin-nav-dot {
55
+ display: inline-block;
56
+ width: .5rem;
57
+ height: .5rem;
58
+ margin-right: .3rem;
59
+ border-radius: 50%;
60
+ }
@@ -69,7 +69,10 @@
69
69
  }
70
70
  }
71
71
 
72
- // Left docs sidebar FAB — mirrors .bd-toc-fab on the opposite edge
72
+ // Left docs sidebar FAB — mirrors .bd-toc-fab on the opposite edge.
73
+ // Owns slot 2 of the left-side FAB stack below lg (slot 1 = #pageFeedbackFab);
74
+ // the Obsidian local-graph FAB yields and moves to slot 3 whenever this FAB is
75
+ // on the page (see _sass/core/_obsidian.scss, #571).
73
76
  .bd-sidebar-fab {
74
77
  left: var(--zer0-space-fab-offset, 1rem);
75
78
  z-index: var(--zer0-layer-fab-toc);
@@ -162,9 +165,11 @@
162
165
  color: var(--bs-primary);
163
166
  }
164
167
 
168
+ // Current page: the strong link shade on the subtle fill (brand text was
169
+ // 1.92:1 on #cfe2ff for air; the plain link colour still fails mint).
165
170
  &[aria-current="page"] {
166
171
  font-weight: 600;
167
- color: var(--bs-primary);
172
+ color: var(--bs-link-hover-color);
168
173
  border-color: var(--bs-primary);
169
174
  background-color: var(--bs-primary-bg-subtle);
170
175
  }
@@ -4,6 +4,21 @@
4
4
  // Maps each data-theme-skin to Bootstrap + --zer0-color-* tokens so skin
5
5
  // previews affect buttons, links, borders, cards, nav, and alerts — not just
6
6
  // SVG backgrounds. Color values mirror _data/theme_backgrounds.yml.
7
+ //
8
+ // Contrast contract (WCAG 2.1 SC 1.4.3: 4.5:1 for text; #410 / T-042):
9
+ // - $brand is a SURFACE colour. Text never uses it raw: the light brands
10
+ // (air, aqua, mint, plum, sunrise) sit at 2.3-2.7:1 on white and the dark
11
+ // ones (dirt, neon) at 2.4-2.6:1 on #212529.
12
+ // - Ordinary brand text (.text-primary, .link-primary, .page-link, outline
13
+ // buttons) uses the link colour of the current mode.
14
+ // - Selected and current states (active tab, current crumb, active navbar
15
+ // link) and text on a brand tint (.alert-primary) use the stronger
16
+ // link-hover shade: darker than the link in light mode, lighter in dark.
17
+ // - Text ON a brand fill (.btn-primary, .badge.bg-primary, .text-bg-primary,
18
+ // active list and page items, the current dropdown item) uses $on-brand,
19
+ // exposed as --zer0-color-on-primary.
20
+ // Each skin below carries its measured ratios (Python, WCAG 2.x relative
21
+ // luminance; button states use the same 85% / 75% color-mix as the CSS).
7
22
  // ==========================================================================
8
23
 
9
24
  // $link-light / $link-light-hover — link colors for light mode; should reach
@@ -11,22 +26,32 @@
11
26
  // $link-dark / $link-dark-hover — link colors for dark mode; should reach
12
27
  // WCAG AA (≥4.5:1) against Bootstrap's dark body background (#212529).
13
28
  // Falls back to $brand (light) / $accent (dark) when not supplied.
29
+ // $on-brand — text on a $brand fill. Must reach 4.5:1 on $brand AND on the
30
+ // .btn-primary hover/active mixes. White only works on the dark brands;
31
+ // the light ones pass #000 (Bootstrap's color-contrast() dark choice).
32
+ // $brand-shade — what the .btn-primary hover (85%) and active (75%) states mix
33
+ // toward. Falls back to $accent; a skin whose light accent would pull the
34
+ // mix under 4.5:1 against $on-brand passes a darker shade instead.
14
35
  @mixin zer0-skin-palette(
15
36
  $brand, $brand-rgb, $accent, $accent-rgb: null,
16
37
  $link-light: null, // WCAG-AA color on white (light mode)
17
38
  $link-light-hover: null, // Hover variant in light mode
18
39
  $link-dark: null, // WCAG-AA color on dark bg (dark mode)
19
- $link-dark-hover: null // Hover variant in dark mode
40
+ $link-dark-hover: null, // Hover variant in dark mode
41
+ $on-brand: #fff, // Text on a $brand fill (buttons, badges, active items)
42
+ $brand-shade: null // .btn-primary hover/active mix target; defaults to $accent
20
43
  ) {
21
44
  // Resolve: fall back to $brand / $accent when params are omitted
22
45
  $_ll: if($link-light != null, $link-light, $brand);
23
46
  $_llh: if($link-light-hover != null, $link-light-hover, $_ll);
24
47
  $_ld: if($link-dark != null, $link-dark, $accent);
25
48
  $_ldh: if($link-dark-hover != null, $link-dark-hover, $_ld);
49
+ $_shade: if($brand-shade != null, $brand-shade, $accent);
26
50
 
27
51
  --zer0-color-primary: #{$brand};
28
52
  --zer0-color-primary-rgb: #{$brand-rgb};
29
53
  --zer0-color-accent: #{$accent};
54
+ --zer0-color-on-primary: #{$on-brand};
30
55
  --bs-primary: #{$brand};
31
56
  --bs-primary-rgb: #{$brand-rgb};
32
57
 
@@ -44,32 +69,50 @@
44
69
  --zer0-color-bg-muted: color-mix(in srgb, #{$brand} 6%, var(--bs-secondary-bg, var(--bs-body-bg)));
45
70
 
46
71
  // Bootstrap component wiring
72
+ // Bootstrap leaves --bs-btn-color white; on the light brands that was
73
+ // 2.2-2.8:1 (air 2.53:1 at rest), so every state takes $on-brand.
47
74
  .btn-primary {
75
+ --bs-btn-color: #{$on-brand};
48
76
  --bs-btn-bg: #{$brand};
49
77
  --bs-btn-border-color: #{$brand};
50
- --bs-btn-hover-bg: color-mix(in srgb, #{$brand} 85%, #{$accent});
51
- --bs-btn-hover-border-color: color-mix(in srgb, #{$brand} 85%, #{$accent});
52
- --bs-btn-active-bg: color-mix(in srgb, #{$brand} 75%, #{$accent});
53
- --bs-btn-active-border-color: color-mix(in srgb, #{$brand} 75%, #{$accent});
78
+ --bs-btn-hover-color: #{$on-brand};
79
+ --bs-btn-hover-bg: color-mix(in srgb, #{$brand} 85%, #{$_shade});
80
+ --bs-btn-hover-border-color: color-mix(in srgb, #{$brand} 85%, #{$_shade});
81
+ --bs-btn-active-color: #{$on-brand};
82
+ --bs-btn-active-bg: color-mix(in srgb, #{$brand} 75%, #{$_shade});
83
+ --bs-btn-active-border-color: color-mix(in srgb, #{$brand} 75%, #{$_shade});
54
84
  }
55
85
 
56
86
  .btn-outline-primary {
57
- --bs-btn-color: #{$brand};
87
+ --bs-btn-color: var(--bs-link-color);
58
88
  --bs-btn-border-color: #{$brand};
89
+ --bs-btn-hover-color: #{$on-brand};
59
90
  --bs-btn-hover-bg: #{$brand};
60
91
  --bs-btn-hover-border-color: #{$brand};
92
+ --bs-btn-active-color: #{$on-brand};
61
93
  --bs-btn-active-bg: #{$brand};
62
94
  --bs-btn-active-border-color: #{$brand};
63
95
  }
64
96
 
97
+ // Brand-filled badges: .bg-primary paints the fill, so the badge text has to
98
+ // follow it (Bootstrap's --bs-badge-color is a fixed #fff). .text-bg-primary
99
+ // sets its colour with !important, so the override needs one too.
100
+ .badge.bg-primary {
101
+ --bs-badge-color: #{$on-brand};
102
+ }
103
+
104
+ .text-bg-primary {
105
+ color: #{$on-brand} !important;
106
+ }
107
+
65
108
  .alert-primary {
66
- --bs-alert-color: #{$brand};
109
+ --bs-alert-color: var(--bs-link-hover-color);
67
110
  --bs-alert-bg: rgba(#{$brand-rgb}, 0.12);
68
111
  --bs-alert-border-color: rgba(#{$brand-rgb}, 0.35);
69
112
  }
70
113
 
71
114
  .nav-tabs .nav-link.active {
72
- color: #{$brand};
115
+ color: var(--bs-link-hover-color);
73
116
  border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);
74
117
  }
75
118
 
@@ -86,6 +129,18 @@
86
129
  color: var(--bs-link-color);
87
130
  }
88
131
 
132
+ // Current and active links sit on a tint: the sidebar trees mark the current
133
+ // page (.active, aria-current) on --bs-primary-bg-subtle, the TOC scroll-spy
134
+ // marks its section on a brand tint. The plain link colour falls under 4.5:1
135
+ // there (mint 3.68:1, sunrise 4.20:1, aqua 4.38:1 on #cfe2ff), so they take
136
+ // the stronger link-hover shade. The extra .active / [aria-current] outranks
137
+ // the rule above; brand-filled .list-group-item / .page-link are left to
138
+ // their own rules below.
139
+ a.active:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.list-group-item):not(.page-link),
140
+ a[aria-current="page"]:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge) {
141
+ color: var(--bs-link-hover-color);
142
+ }
143
+
89
144
  a:not(.btn):not(.badge):hover {
90
145
  color: var(--bs-link-hover-color);
91
146
  }
@@ -96,8 +151,10 @@
96
151
  border-color: var(--zer0-color-border);
97
152
  }
98
153
 
99
- // List group active state
154
+ // List group active state. !important: an <a class="list-group-item"> is
155
+ // otherwise repainted by the link rules above (specificity 0,5,1).
100
156
  .list-group-item.active {
157
+ color: #{$on-brand} !important;
101
158
  background-color: #{$brand};
102
159
  border-color: #{$brand};
103
160
  }
@@ -121,16 +178,19 @@
121
178
 
122
179
  // Pagination & breadcrumbs
123
180
  .page-link {
124
- color: #{$brand};
181
+ color: var(--bs-link-color);
125
182
  }
126
183
 
127
- .page-item.active .page-link {
184
+ // !important for the same reason as .list-group-item.active above.
185
+ .page-item.active .page-link,
186
+ .page-link.active {
187
+ color: #{$on-brand} !important;
128
188
  background-color: #{$brand};
129
189
  border-color: #{$brand};
130
190
  }
131
191
 
132
192
  .breadcrumb-item.active {
133
- color: #{$brand};
193
+ color: var(--bs-link-hover-color);
134
194
  }
135
195
 
136
196
  // Progress
@@ -147,15 +207,16 @@
147
207
  border-color: rgba(var(--bs-primary-rgb), 0.4);
148
208
  }
149
209
 
150
- // Navbar snippet / active nav links
210
+ // Navbar snippet / active nav links (the navbar is --bs-tertiary-bg)
151
211
  .navbar .nav-link.active,
152
212
  .navbar .nav-link.show {
153
- color: #{$brand};
213
+ color: var(--bs-link-hover-color);
154
214
  }
155
215
 
156
- // Text & border utilities tied to primary
216
+ // Text & border utilities tied to primary. Text takes the link colour of
217
+ // the current mode; the border keeps the brand (non-text, decorative).
157
218
  .text-primary {
158
- color: #{$brand} !important;
219
+ color: var(--bs-link-color) !important;
159
220
  }
160
221
 
161
222
  .border-primary {
@@ -163,7 +224,7 @@
163
224
  }
164
225
 
165
226
  .link-primary {
166
- color: #{$brand} !important;
227
+ color: var(--bs-link-color) !important;
167
228
  }
168
229
 
169
230
  // Dark-mode link overrides — switch to lighter tones for contrast on dark bg
@@ -175,86 +236,117 @@
175
236
  }
176
237
  }
177
238
 
239
+ // Measured ratios (WCAG 2.x relative luminance; 4.5:1 is AA for text).
240
+ // "navbar" is --bs-tertiary-bg (#f8f9fa light, #2b3035 dark); "card" is the
241
+ // 10% brand tint on .card; "tints" is the worst of --bs-primary-bg-subtle and
242
+ // the 10-15% brand tints that active states and .alert-primary sit on;
243
+ // "on-brand" is .btn-primary at rest, hover (85% mix) and active (75% mix).
244
+
178
245
  // air — steel blue
179
- // Light: #1e5fa8 (≈6.5:1 on white) / Dark: #b8d4e3 (≈8.5:1 on #212529)
246
+ // light link #1e5fa8 6.45 white · 6.12 navbar · 5.94 card; hover #154a87 ≥ 6.77 on tints
247
+ // dark link #b8d4e3 9.96 body · 8.60 navbar · 8.40 card; hover #d6eaf4 ≥ 9.56 on tints
248
+ // on-brand #000 8.31 · 8.97 · 9.44 (white was 2.53 · 2.34 · 2.23)
180
249
  [data-theme-skin="air"] {
181
250
  @include zer0-skin-palette(
182
251
  #6fa8dc, "111, 168, 220", #b8d4e3,
183
252
  $link-light: #1e5fa8,
184
253
  $link-light-hover: #154a87,
185
254
  $link-dark: #b8d4e3,
186
- $link-dark-hover: #d6eaf4
255
+ $link-dark-hover: #d6eaf4,
256
+ $on-brand: #000
187
257
  );
188
258
  }
189
259
 
190
260
  // aqua — cyan/teal
191
- // Light: #006d99 (≈5.5:1 on white) / Dark: #67d7ec (≈8.0:1 on #212529)
261
+ // light link #006d99 5.76 white · 5.46 navbar · 5.24 card; hover #005577 ≥ 6.23 on tints
262
+ // dark link #67d7ec 9.19 body · 7.93 navbar · 7.84 card; hover #9ae8f5 ≥ 8.73 on tints
263
+ // on-brand #000 8.52 · 9.14 · 9.58 (white was 2.46 · 2.30 · 2.19)
192
264
  [data-theme-skin="aqua"] {
193
265
  @include zer0-skin-palette(
194
266
  #00b4d8, "0, 180, 216", #90e0ef,
195
267
  $link-light: #006d99,
196
268
  $link-light-hover: #005577,
197
269
  $link-dark: #67d7ec,
198
- $link-dark-hover: #9ae8f5
270
+ $link-dark-hover: #9ae8f5,
271
+ $on-brand: #000
199
272
  );
200
273
  }
201
274
 
202
275
  // dirt — earthy gold/brown
203
- // Light: #7a5a10 (≈5.0:1 on white) / Dark: #e0b882 (≈7.0:1 on #212529)
276
+ // light link #7a5a10 6.37 white · 6.04 navbar · 5.59 card; hover #5c430c ≥ 7.06 on tints
277
+ // dark link #e0b882 8.34 body · 7.20 navbar · 7.61 card; hover #f0cea0 ≥ 8.96 on tints
278
+ // on-brand #fff 5.09 · 5.55 · 5.88 — hover/active mix toward the dark
279
+ // link-hover brown: toward the #d4a574 accent they were 4.44 · 4.07, and
280
+ // #000 is only 4.13 on the brand itself.
204
281
  [data-theme-skin="dirt"] {
205
282
  @include zer0-skin-palette(
206
283
  #8b6914, "139, 105, 20", #d4a574,
207
284
  $link-light: #7a5a10,
208
285
  $link-light-hover: #5c430c,
209
286
  $link-dark: #e0b882,
210
- $link-dark-hover: #f0cea0
287
+ $link-dark-hover: #f0cea0,
288
+ $on-brand: #fff,
289
+ $brand-shade: #5c430c
211
290
  );
212
291
  }
213
292
 
214
293
  // neon — electric purple/blue
215
- // Light: #5e22cc (≈5.5:1 on white) / Dark: #8ab4ff (≈6.0:1 on #212529)
294
+ // light link #5e22cc 8.15 white · 7.73 navbar · 7.03 card; hover #4a1aa3 ≥ 8.12 on tints
295
+ // dark link #8ab4ff 7.38 body · 6.38 navbar · 6.90 card; hover #b0ccff ≥ 8.53 on tints
296
+ // on-brand #fff 5.61 · 5.44 · 5.27
216
297
  [data-theme-skin="neon"] {
217
298
  @include zer0-skin-palette(
218
299
  #8338ec, "131, 56, 236", #3a86ff, "58, 134, 255",
219
300
  $link-light: #5e22cc,
220
301
  $link-light-hover: #4a1aa3,
221
302
  $link-dark: #8ab4ff,
222
- $link-dark-hover: #b0ccff
303
+ $link-dark-hover: #b0ccff,
304
+ $on-brand: #fff
223
305
  );
224
306
  }
225
307
 
226
308
  // mint — forest green
227
- // Light: #2d8059 (≈5.5:1 on white) / Dark: #80cfa8 (≈7.5:1 on #212529)
309
+ // light link #287652 5.52 white · 5.24 navbar · 5.08 card; hover #1f5a3b ≥ 6.18 on tints
310
+ // (was #2d8059: 4.83 white, 4.45 on the card tint)
311
+ // dark link #80cfa8 8.38 body · 7.23 navbar · 7.07 card; hover #a8e6c4 ≥ 8.35 on tints
312
+ // on-brand #000 8.49 · 9.00 · 9.35 (white was 2.47 · 2.33 · 2.24)
228
313
  [data-theme-skin="mint"] {
229
314
  @include zer0-skin-palette(
230
315
  #52b788, "82, 183, 136", #95d5b2,
231
- $link-light: #2d8059,
316
+ $link-light: #287652,
232
317
  $link-light-hover: #1f5a3b,
233
318
  $link-dark: #80cfa8,
234
- $link-dark-hover: #a8e6c4
319
+ $link-dark-hover: #a8e6c4,
320
+ $on-brand: #000
235
321
  );
236
322
  }
237
323
 
238
324
  // plum — deep violet
239
- // Light: #6b2477 (≈8.0:1 on white) / Dark: #d4a0f5 (≈7.0:1 on #212529)
325
+ // light link #6b2477 9.80 white · 9.29 navbar · 8.95 card; hover #4e1958 ≥ 9.96 on tints
326
+ // dark link #d4a0f5 7.45 body · 6.43 navbar · 6.37 card; hover #e8c8ff ≥ 8.15 on tints
327
+ // on-brand #000 7.81 · 6.75 · 6.10 (white was 2.69 · 3.11 · 3.44)
240
328
  [data-theme-skin="plum"] {
241
329
  @include zer0-skin-palette(
242
330
  #c77dff, "199, 125, 255", #812f85,
243
331
  $link-light: #6b2477,
244
332
  $link-light-hover: #4e1958,
245
333
  $link-dark: #d4a0f5,
246
- $link-dark-hover: #e8c8ff
334
+ $link-dark-hover: #e8c8ff,
335
+ $on-brand: #000
247
336
  );
248
337
  }
249
338
 
250
339
  // sunrise — warm terracotta/orange
251
- // Light: #b54418 (≈5.5:1 on white) / Dark: #ffa87a (≈7.0:1 on #212529)
340
+ // light link #b54418 5.52 white · 5.24 navbar · 4.98 card; hover #8f3512 ≥ 5.95 on tints
341
+ // dark link #ffa87a 8.18 body · 7.06 navbar · 7.15 card; hover #ffd0b0 ≥ 8.85 on tints
342
+ // on-brand #000 7.41 · 8.00 · 8.46 (white was 2.84 · 2.62 · 2.48)
252
343
  [data-theme-skin="sunrise"] {
253
344
  @include zer0-skin-palette(
254
345
  #ff6b35, "255, 107, 53", #f7c59f,
255
346
  $link-light: #b54418,
256
347
  $link-light-hover: #8f3512,
257
348
  $link-dark: #ffa87a,
258
- $link-dark-hover: #ffd0b0
349
+ $link-dark-hover: #ffd0b0,
350
+ $on-brand: #000
259
351
  );
260
352
  }
@@ -20,6 +20,9 @@
20
20
  --zer0-color-primary-rgb: var(--bs-primary-rgb, 0, 123, 255);
21
21
  --zer0-color-secondary: var(--bs-secondary, #6c757d);
22
22
  --zer0-color-accent: var(--bd-accent, #ffe484);
23
+ // Text on a primary fill. White passes on Bootstrap's #0d6efd (4.50:1); the
24
+ // palette skins in _sass/theme/_skins.scss set #000 on their light brands.
25
+ --zer0-color-on-primary: #fff;
23
26
 
24
27
  // Semantic state ---------------------------------------------------------
25
28
  --zer0-color-success: var(--bs-success, #28a745);
@@ -17,11 +17,18 @@
17
17
  --zer0-layer-backdrop: 1040;
18
18
 
19
19
  // Floating action buttons (stack bottom-to-top) --------------------------
20
- --zer0-layer-fab-back-to-top: 1050;
21
- --zer0-layer-fab-feedback: 1051; // page-feedback FAB (bottom-left)
22
- --zer0-layer-fab-chat: 1052;
23
- --zer0-layer-fab-toc: 1055;
24
- --zer0-layer-fab-local-graph: 1060;
20
+ // The whole band sits between the header and the backdrop, so an open
21
+ // overlay always covers every FAB: header 1030 < FABs < backdrop 1040 <
22
+ // offcanvas 1045 < modal 1055. FABs never overlap the fixed header, so
23
+ // nothing else had to move. Putting the band above the overlays (the old
24
+ // 1050-1060) left the TOC and local-graph FABs painted over — and still
25
+ // hit-testable on top of — the open search modal, nav menu and TOC panel
26
+ // (issue #572). Keep every FAB in 1031-1039.
27
+ --zer0-layer-fab-back-to-top: 1031;
28
+ --zer0-layer-fab-feedback: 1032; // page-feedback FAB (bottom-left)
29
+ --zer0-layer-fab-chat: 1033;
30
+ --zer0-layer-fab-toc: 1034;
31
+ --zer0-layer-fab-local-graph: 1035;
25
32
 
26
33
  // Overlay surfaces -------------------------------------------------------
27
34
  --zer0-layer-offcanvas: 1045;
@@ -29,10 +29,21 @@ summary:focus-visible {
29
29
  // Safe here specifically because the element is tabindex="-1": it is never
30
30
  // reachable by Tab, so no keyboard user can land on it and be left without an
31
31
  // indicator. Do not generalise this selector to focusable elements.
32
- #main-content:focus {
32
+ #main-content:focus,
33
+ #page-content:focus {
33
34
  outline: none;
34
35
  }
35
36
 
37
+ // The header's "Skip to main content" link (core/header.html). Bootstrap's
38
+ // visually-hidden-focusable reveals it on focus, but it sat at `z-3` under the
39
+ // fixed-top navbar (z-index 1030), so a focused skip link was invisible. When
40
+ // focused it is pinned to the viewport above the navbar and the cookie banner.
41
+ .zer0-skip-to-content:focus,
42
+ .zer0-skip-to-content:focus-within {
43
+ position: fixed !important;
44
+ z-index: var(--zer0-layer-skip-link, 1100) !important;
45
+ }
46
+
36
47
  // Skip-to-content link — visually hidden until focused
37
48
  .zer0-skip-link {
38
49
  position: absolute;
data/assets/css/main.scss CHANGED
@@ -50,6 +50,7 @@
50
50
  @import "layouts/landing";
51
51
  @import "layouts/section";
52
52
  @import "layouts/navbar-extras";
53
+ @import "layouts/admin";
53
54
 
54
55
  // 7. Bootstrap Styles
55
56
  // @import "bootstrap.scss";
@@ -152,10 +152,33 @@ document.addEventListener('DOMContentLoaded', function () {
152
152
  if (preElement) preElements.add(preElement);
153
153
  });
154
154
 
155
+ // Every region needs a name of its own (axe landmark-unique, #593): two
156
+ // blocks both called "bash code block" are one landmark listed twice in a
157
+ // screen reader's region list, with nothing to tell them apart. So count the
158
+ // names first, and number a name's blocks ("bash code block 2") only when
159
+ // the page has more than one of it.
160
+ function regionName(preElement) {
161
+ return (getLanguageLabel(preElement) || 'Code') + ' code block';
162
+ }
163
+ function needsRegionName(preElement) {
164
+ return !!preElement.querySelector('code') &&
165
+ !preElement.hasAttribute('tabindex') &&
166
+ !preElement.hasAttribute('aria-label');
167
+ }
168
+ var regionNameTotals = {};
169
+ var regionNameSeen = {};
170
+ preElements.forEach(function (preElement) {
171
+ if (!needsRegionName(preElement)) return;
172
+ var name = regionName(preElement);
173
+ regionNameTotals[name] = (regionNameTotals[name] || 0) + 1;
174
+ });
175
+
155
176
  preElements.forEach(function (preElement) {
156
177
  var codeElement = preElement.querySelector('code');
157
178
  if (!codeElement) return;
158
179
 
180
+ var labelRegion = needsRegionName(preElement);
181
+
159
182
  ensureLineNumbers(preElement, codeElement);
160
183
 
161
184
  // a11y (WCAG 2.1.1 scrollable-region-focusable): a code block that can
@@ -164,8 +187,13 @@ document.addEventListener('DOMContentLoaded', function () {
164
187
  if (!preElement.hasAttribute('tabindex')) {
165
188
  preElement.setAttribute('tabindex', '0');
166
189
  if (!preElement.hasAttribute('role')) preElement.setAttribute('role', 'region');
167
- if (!preElement.hasAttribute('aria-label')) {
168
- preElement.setAttribute('aria-label', (getLanguageLabel(preElement) || 'Code') + ' code block');
190
+ if (labelRegion) {
191
+ var name = regionName(preElement);
192
+ if (regionNameTotals[name] > 1) {
193
+ regionNameSeen[name] = (regionNameSeen[name] || 0) + 1;
194
+ name += ' ' + regionNameSeen[name];
195
+ }
196
+ preElement.setAttribute('aria-label', name);
169
197
  }
170
198
  }
171
199