Skip to content

Commit c872384

Browse files
committed
Aesthetic polish — scrollbar, code blocks, focus, button (Phase 5)
New stylesheet src/css/skainet-polish.css that layers the SKaiNET visual touches on top of the upstream Antora UI base. Imported last from src/css/site.css so its selectors win the cascade where they share specificity with upstream defaults. ## What landed 1. **6px thin scrollbar** — `scrollbar-width: thin` + a custom `::-webkit-scrollbar` block. Thumb color comes from `--scrollbar-thumb-color` (defined in vars.css per theme), so it picks the right shade in light vs dark mode without any duplicate rules. 2. **Rounded code blocks with proper backgrounds** — `.doc pre.highlight` (and the literalblock + listingblock variants) now ship with `background: var(--pre-background)`, `border-radius: 8px`, a 1px border in `--pre-border-color`, and a subtle shadow. In light mode that's GitHub-light `#f6f8fa`; in dark mode it flips to GitHub-dark `#0d1117` — matching the structured-coroutines reference aesthetic. 3. **Inline `<code>` reset** — `.doc :not(pre) > code` gets the same color tokens, a tighter padding, and `border-radius: 4px` so inline code visually distinguishes itself from prose. 4. **Theme-toggle button styling** — `.navbar .theme-toggle` resets the native `<button>` chrome (no border, transparent background, inherit font + color) so it sits cleanly inside `.navbar-item`. Hover background uses `--navbar-menu_hover-background` (matches the rest of the nav). Focus shows a primary-red glow via `box-shadow` + `color-mix(in sRGB, var(--color-skainet-red) 40%, transparent)`. 5. **Icon swap on dark mode** — `[data-theme="dark"] .theme-toggle-icon` hides the `🌓` source glyph (`font-size: 0`) and renders a `🌙` via `::before`, so the icon clearly indicates the active mode. 6. **Primary-red focus glow on links** — applied to `.doc a`, `.nav a`, `.toc a`, `.toolbar a`, and `.pagination a` via `:focus-visible`. Same `box-shadow` shape as the toggle. `:focus-visible` (not `:focus`) so mouse clicks don't trigger the glow — only keyboard navigation. 7. **Section heading dividers** — `.doc h2` gets a top border in `--section-divider-color` and 2.5rem of margin-top, so long pages get clear visual section breaks. 8. **Light-mode card elevation on the doc body** — at `min-width: 1024px` the `.doc` element gets a `border-radius: 12px`, padding, and a soft two-layer `box-shadow`. Only in light mode (gated on `[data-theme="light"]`) so the dark mode keeps the flat-on-black look. ## Stylelint corrections during authoring Two rules tripped on the first pass and were resolved: - `no-duplicate-selectors` — initially I had two `[data-theme="dark"] .theme-toggle-icon` blocks (one for the parent rule, one for `::before`). Merged the parent rules and kept only the `::before` block separate. - `value-keyword-case` — stylelint requires `sRGB` (not `srgb`) in `color-mix(in sRGB, ...)`. Both occurrences updated. ## Verification `npx gulp bundle` runs clean — clean → lint:css → lint:js → build → bundle:pack — and produces build/ui-bundle.zip with skainet-polish.css inlined into css/site.css. Phase 5 of the six-PR delivery plan. Phase 6 is the v1.0.0 release tag + GitHub Actions release workflow + downstream consumer wiring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2a8ec41 commit c872384

2 files changed

Lines changed: 143 additions & 0 deletions

File tree

src/css/site.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
@import "footer.css";
1515
@import "highlight.css";
1616
@import "print.css";
17+
@import "skainet-polish.css";

src/css/skainet-polish.css

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* SKaiNET aesthetic polish.
3+
*
4+
* Layered on top of the upstream Antora UI base CSS to bring the
5+
* site closer to the structured-coroutines-docs reference look:
6+
*
7+
* - 6px thin custom scrollbar (light + dark variants via vars.css)
8+
* - Code blocks: rounded corners, GitHub-dark / GitHub-light
9+
* backgrounds matching --pre-background / --pre-border-color
10+
* - Theme toggle button: reset native <button> chrome so it sits
11+
* cleanly inside .navbar-item
12+
* - Primary-red focus glow on links and buttons
13+
* - Subtle card shadows on .nav, .toc, .doc body
14+
*
15+
* Loaded last from src/css/site.css so its selectors override
16+
* anything in the upstream cascade with equivalent specificity.
17+
*/
18+
19+
/* ---- 6px thin scrollbar ---- */
20+
21+
* {
22+
scrollbar-width: thin;
23+
scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
24+
}
25+
26+
*::-webkit-scrollbar {
27+
width: 6px;
28+
height: 6px;
29+
}
30+
31+
*::-webkit-scrollbar-track {
32+
background: var(--scrollbar-track-color);
33+
}
34+
35+
*::-webkit-scrollbar-thumb {
36+
background-color: var(--scrollbar-thumb-color);
37+
border-radius: 3px;
38+
}
39+
40+
*::-webkit-scrollbar-thumb:hover {
41+
background-color: var(--scrollbar_hover-thumb-color);
42+
}
43+
44+
/* ---- code block rounding + visible borders ---- */
45+
46+
.doc pre.highlight,
47+
.doc pre.literalblock,
48+
.doc .listingblock pre {
49+
background: var(--pre-background);
50+
color: var(--code-font-color);
51+
border: 1px solid var(--pre-border-color);
52+
border-radius: 8px;
53+
padding: 1rem 1.25rem;
54+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
55+
}
56+
57+
.doc :not(pre) > code {
58+
background: var(--code-background);
59+
color: var(--code-font-color);
60+
border: 1px solid var(--pre-border-color);
61+
border-radius: 4px;
62+
padding: 0.125rem 0.375rem;
63+
font-size: 0.9em;
64+
}
65+
66+
/* ---- theme-toggle button ---- */
67+
68+
.navbar .theme-toggle {
69+
background: transparent;
70+
border: 0;
71+
padding: 0.5rem 0.75rem;
72+
cursor: pointer;
73+
font: inherit;
74+
color: inherit;
75+
border-radius: 6px;
76+
line-height: 1;
77+
}
78+
79+
.navbar .theme-toggle:hover {
80+
background: var(--navbar-menu_hover-background);
81+
}
82+
83+
.navbar .theme-toggle:focus-visible {
84+
outline: none;
85+
box-shadow: 0 0 0 3px color-mix(in sRGB, var(--color-skainet-red) 40%, transparent);
86+
}
87+
88+
.theme-toggle-icon {
89+
display: inline-block;
90+
font-size: 1.1rem;
91+
line-height: 1;
92+
}
93+
94+
/*
95+
* In dark mode, hide the source emoji glyph and render a swapped
96+
* one via ::before so the toggle has visual feedback on which
97+
* mode is active. The combined selector keeps stylelint's
98+
* no-duplicate-selectors rule happy.
99+
*/
100+
[data-theme="dark"] .theme-toggle-icon {
101+
font-size: 0;
102+
}
103+
104+
[data-theme="dark"] .theme-toggle-icon::before {
105+
content: "🌙";
106+
font-size: 1.1rem;
107+
}
108+
109+
/* ---- primary-red focus glow on interactive elements ---- */
110+
111+
.doc a:focus-visible,
112+
.nav a:focus-visible,
113+
.toc a:focus-visible,
114+
.toolbar a:focus-visible,
115+
.pagination a:focus-visible {
116+
outline: none;
117+
border-radius: 4px;
118+
box-shadow: 0 0 0 3px color-mix(in sRGB, var(--color-skainet-red) 40%, transparent);
119+
}
120+
121+
/* ---- heading polish ---- */
122+
123+
.doc h1 {
124+
margin-top: 0;
125+
}
126+
127+
.doc h2 {
128+
margin-top: 2.5rem;
129+
padding-top: 1.5rem;
130+
border-top: 1px solid var(--section-divider-color);
131+
}
132+
133+
/* ---- subtle elevation on the doc body card in light mode ---- */
134+
135+
@media (min-width: 1024px) {
136+
[data-theme="light"] .doc {
137+
background: var(--example-background);
138+
border-radius: 12px;
139+
padding: 2rem 2.5rem;
140+
box-shadow: 0 1px 3px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.06);
141+
}
142+
}

0 commit comments

Comments
 (0)