From a1af45c66bf7f62680a2461382c2692d52c78aec Mon Sep 17 00:00:00 2001 From: Marko Stijak Date: Fri, 27 Nov 2026 10:02:20 +0100 Subject: [PATCH 1/4] docs: refresh the documentation site's look - Colors: the logo cyan is the single accent color in both themes (dark mode used indigo, violet and teal); link text in light mode uses a darker cyan for contrast, and inline code uses violet from the logo, slightly smaller - Links underline on hover - Code examples: a fade and "N more lines" hint when the code continues below the visible area; compact, scrollable file tabs on phones - Docs header: the same logo as the homepage, with "CxJS Docs" linking back to the homepage and the docs start - Sidebar: the active page is scrolled into view when a page is opened directly; denser rows; each group has a rail line with the active page marked in cyan and hovered pages in gray - Dark mode no longer flashes light colors during client-side navigation - Import line under page titles follows the theme colors - Homepage: feature cards no longer stay invisible without the script, all motion is disabled with "reduce motion", and the heading wraps evenly on phones --- homedocs/src/components/CodeExample.astro | 120 +++++++++++++++++- homedocs/src/components/Header.astro | 24 +++- .../src/components/HoneycombBackground.astro | 2 + homedocs/src/components/ImportPath.astro | 14 +- homedocs/src/components/NavItem.astro | 41 +++++- homedocs/src/components/Sidebar.astro | 19 ++- homedocs/src/components/SidebarSection.astro | 2 +- homedocs/src/layouts/BaseLayout.astro | 11 ++ homedocs/src/pages/index.astro | 43 +++++-- homedocs/src/pages/new-landing.astro | 4 +- homedocs/src/styles/global.scss | 31 +++-- homedocs/src/styles/homedocsDark.ts | 1 + homedocs/src/styles/prose.scss | 25 ++-- 13 files changed, 285 insertions(+), 52 deletions(-) diff --git a/homedocs/src/components/CodeExample.astro b/homedocs/src/components/CodeExample.astro index 276f888fc..186536be3 100644 --- a/homedocs/src/components/CodeExample.astro +++ b/homedocs/src/components/CodeExample.astro @@ -394,15 +394,16 @@ const stackblitzProjectData = stackblitzProject && JSON.stringify(stackblitzProj { hasTabs && (
+
{modelCode && ( )} +
{stackblitzProject && (
@@ -578,6 +585,51 @@ const stackblitzProjectData = stackblitzProject && JSON.stringify(stackblitzProj color: rgba(255, 255, 255, 0.5); } + /* On narrow screens the tabs scroll sideways, without a visible scrollbar */ + .code-tab-list { + scrollbar-width: none; + } + + .code-tab-list::-webkit-scrollbar { + display: none; + } + + /* Scroll hint: a fade along the bottom edge and a count of the lines below it. Both are overlays, so showing or + hiding them does not change the layout. */ + .code-scroll-fade, + .code-scroll-more { + position: absolute; + pointer-events: none; + opacity: 0; + transition: opacity 0.15s ease; + } + + .code-scroll-fade { + left: 0; + right: 0; + bottom: 0; + height: 3rem; + background: linear-gradient(to bottom, transparent, hsl(var(--code-bg))); + } + + .code-scroll-more { + right: 0.75rem; + bottom: 0.5rem; + padding: 0.125rem 0.5rem; + border-radius: 9999px; + font-size: 11px; + line-height: 1.5; + font-weight: 500; + color: rgba(255, 255, 255, 0.75); + background: hsl(var(--code-bg) / 0.85); + border: 1px solid hsl(var(--code-border)); + } + + .code-scroll-area[data-more] .code-scroll-fade, + .code-scroll-area[data-more] .code-scroll-more { + opacity: 1; + } + .code-tab:hover { color: rgba(255, 255, 255, 0.8); } @@ -647,6 +699,62 @@ const stackblitzProjectData = stackblitzProject && JSON.stringify(stackblitzProj initCodeExampleTabs(); document.addEventListener("astro:page-load", initCodeExampleTabs); + + // Scroll hint: while the visible tab continues below the bottom edge of the code block, show a fade and the number + // of lines that are cut off or hidden. + function initCodeScrollHints() { + document.querySelectorAll(".code-example .code-scroll-area").forEach(function (area) { + if (area.dataset.scrollHint) return; + area.dataset.scrollHint = "1"; + + var wrapper = area.querySelector(".code-content-wrapper"); + var fade = area.querySelector(".code-scroll-fade"); + var label = area.querySelector(".code-scroll-more"); + if (!wrapper || !fade || !label) return; + + function update() { + var bottom = wrapper.getBoundingClientRect().bottom; + var hidden = 0; + wrapper.querySelectorAll(".code-content:not(.hidden) .line").forEach(function (line) { + if (line.getBoundingClientRect().bottom > bottom + 1) hidden++; + }); + + if (hidden > 0) { + // keep the fade off the vertical scrollbar + var scrollbar = wrapper.offsetWidth - wrapper.clientWidth; + fade.style.right = scrollbar + "px"; + label.style.right = 12 + scrollbar + "px"; + label.textContent = "↓ " + hidden + (hidden === 1 ? " more line" : " more lines"); + area.setAttribute("data-more", ""); + } else { + area.removeAttribute("data-more"); + } + } + + wrapper.addEventListener("scroll", update, { passive: true }); + + var example = area.closest(".code-example"); + example.querySelectorAll(".code-tab").forEach(function (tab) { + tab.addEventListener("click", function () { + requestAnimationFrame(update); + }); + }); + + // size changes: viewport width, font loading, code wrapping + if (window.ResizeObserver) { + var observer = new ResizeObserver(update); + observer.observe(wrapper); + wrapper.querySelectorAll(".code-content").forEach(function (content) { + observer.observe(content); + }); + } + + update(); + }); + } + + initCodeScrollHints(); + document.addEventListener("astro:page-load", initCodeScrollHints); + diff --git a/homedocs/src/pages/index.astro b/homedocs/src/pages/index.astro index 7b136068d..0d3096517 100644 --- a/homedocs/src/pages/index.astro +++ b/homedocs/src/pages/index.astro @@ -93,6 +93,29 @@ import InventoryExample from '../examples/homepage/InventoryExample.tsx'; .feature-icon { transition: transform 0.3s ease; } + + /* Cards fade in on scroll. Only the script hides them, so they stay visible if it doesn't run. */ + .js-reveal { + opacity: 0; + } + + /* Reduced motion: no animations, everything shown in its final state */ + @media (prefers-reduced-motion: reduce) { + .float-1, .float-2, .float-3, .float-4, .pulse-glow, .fade-in-up, .slide-in-left, .slide-in-right, .gradient-text { + animation: none !important; + } + .animate-delay-100, .animate-delay-200, .animate-delay-300, .animate-delay-400, .js-reveal { + opacity: 1 !important; + } + .grid-pattern { + animation: none; + opacity: 0.05; + } + .feature-card:hover, + .feature-card:hover .feature-icon { + transform: none; + } + }
@@ -122,8 +145,8 @@ import InventoryExample from '../examples/homepage/InventoryExample.tsx'; Version 26 Now Available
-

- The One-Stop Shop for
Portals and Dashboards +

+ The One-Stop Shop for Portals and Dashboards

@@ -131,11 +154,11 @@ import InventoryExample from '../examples/homepage/InventoryExample.tsx';

- + Get started - + GitHub @@ -409,10 +432,10 @@ import InventoryExample from '../examples/homepage/InventoryExample.tsx';

Get Started - + @@ -478,17 +501,21 @@ import InventoryExample from '../examples/homepage/InventoryExample.tsx'; rootMargin: '0px 0px -50px 0px' }; + // Cards are visible by default and hidden here only when they can be revealed again on scroll + if (!('IntersectionObserver' in window) || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return; + const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { + entry.target.classList.remove('js-reveal'); entry.target.classList.add('fade-in-up'); observer.unobserve(entry.target); } }); }, observerOptions); - document.querySelectorAll('.feature-card').forEach(card => { - card.style.opacity = '0'; + document.querySelectorAll('.feature-card:not(.fade-in-up)').forEach(card => { + card.classList.add('js-reveal'); observer.observe(card); }); } diff --git a/homedocs/src/pages/new-landing.astro b/homedocs/src/pages/new-landing.astro index 08355d7ea..88f9cbb02 100644 --- a/homedocs/src/pages/new-landing.astro +++ b/homedocs/src/pages/new-landing.astro @@ -76,7 +76,7 @@ import InventoryExample from "../examples/homepage/InventoryExample.tsx";
Get started @@ -517,7 +517,7 @@ import InventoryExample from "../examples/homepage/InventoryExample.tsx";

Get started diff --git a/homedocs/src/styles/global.scss b/homedocs/src/styles/global.scss index 096cf886d..0f03992fd 100644 --- a/homedocs/src/styles/global.scss +++ b/homedocs/src/styles/global.scss @@ -53,7 +53,8 @@ --sl-color-gray-7: #f9fafb; --sl-color-accent: #27aae1; --sl-color-accent-low: #e0f4fc; - --sl-color-text-accent: #27aae1; + // Darker than the brand color, for text on light backgrounds (5:1 on white) + --sl-color-text-accent: #0975aa; --sl-color-bg: #ffffff; --sl-color-bg-sidebar: #ffffff; --sl-color-bg-content: #f9fafb; @@ -61,9 +62,13 @@ // CxJS Brand Colors --cx-c-brand: #27aae1; - --cx-c-brand-light: #5bbac7; + --cx-c-brand-light: #5bc4ef; --cx-c-brand-dark: #358dbf; + // Violet from the middle of the logo gradient (#a28cc2), darkened for inline code text (5.5:1 on white) + --cx-c-brand-secondary: #7b55b5; + --code-text: var(--cx-c-brand-secondary); + color-scheme: light; } @@ -77,8 +82,8 @@ --popover: 0 0% 14%; --popover-foreground: 0 0% 98%; - --primary: 234 89% 73%; - --primary-foreground: 243 47% 20%; + --primary: 197 80% 60%; + --primary-foreground: 200 60% 12%; --secondary: 0 0% 18%; --secondary-foreground: 0 0% 98%; @@ -94,7 +99,7 @@ --border: 0 0% 22%; --input: 0 0% 22%; - --ring: 234 89% 73%; + --ring: 197 80% 60%; --code-bg: 0 0% 6%; --code-border: 0 0% 20%; @@ -113,19 +118,23 @@ --sl-color-gray-5: #404040; --sl-color-gray-6: #262626; --sl-color-gray-7: #171717; - --sl-color-accent: #a78bfa; - --sl-color-accent-low: #3b1f6e; - --sl-color-text-accent: #a78bfa; + --sl-color-accent: #47bceb; + --sl-color-accent-low: #0f3a4d; + --sl-color-text-accent: #47bceb; --sl-color-bg: #171717; --sl-color-bg-sidebar: #1f1f1f; --sl-color-bg-content: #262626; --sl-color-text: #fafafa; - // CxJS Brand Colors - Dark mode - --cx-c-brand: #5bbac7; - --cx-c-brand-light: #8fccd5; + // CxJS Brand Colors - Dark mode (lighter cyan, same as --primary) + --cx-c-brand: #47bceb; + --cx-c-brand-light: #7dd0f1; --cx-c-brand-dark: #27aae1; + // Violet from the logo gradient, lightened for dark backgrounds (7.5:1) + --cx-c-brand-secondary: #b39ddb; + --code-text: var(--cx-c-brand-secondary); + color-scheme: dark; } diff --git a/homedocs/src/styles/homedocsDark.ts b/homedocs/src/styles/homedocsDark.ts index e3bee1130..85e7cdef4 100644 --- a/homedocs/src/styles/homedocsDark.ts +++ b/homedocs/src/styles/homedocsDark.ts @@ -9,6 +9,7 @@ const homedocsDarkPreset: ThemeVariables = { // Primary colors primaryColor: "hsl(var(--primary))", + primaryTextColor: "hsl(var(--primary-foreground))", accentColor: "hsl(var(--accent))", accentTextColor: "hsl(0, 0%, 98%)", dangerColor: "#ef4444", diff --git a/homedocs/src/styles/prose.scss b/homedocs/src/styles/prose.scss index ed5a6362b..6329fb801 100644 --- a/homedocs/src/styles/prose.scss +++ b/homedocs/src/styles/prose.scss @@ -55,12 +55,13 @@ .prose a:not(.cxb-button):not(.cxb-tab) { color: var(--sl-color-text-accent); text-decoration: none; - //border-bottom: 1px solid transparent; - //transition: border-color 0.15s ease; +} - &:hover { - //border-bottom-color: currentColor; - } +// Underline text links on hover; cards, anchors and widgets (not-prose) are left alone +.prose a:not(.cxb-button):not(.cxb-tab):not(.heading-anchor):not(.nav-link):not(:where(.not-prose *)):hover { + text-decoration: underline; + text-decoration-thickness: 1px; + text-underline-offset: 3px; } .prose blockquote { @@ -150,9 +151,10 @@ .prose p code, .prose li code { - font-size: inherit; - font-weight: 600; - color: var(--sl-color-text-accent); + // Monospace glyphs are wider and taller than Inter at the same size, so inline code is set slightly smaller + font-size: 0.9em; + font-weight: 500; + color: var(--code-text); background: var(--sl-color-gray-6); @apply px-1 rounded; } @@ -161,6 +163,11 @@ color: var(--sl-color-text-accent); } +// Code inside a link takes the link color, so linked and plain code can be told apart +.prose a code { + color: inherit !important; +} + // Table styles - only apply to direct table children to avoid conflicts with CxJS widgets .prose > table { width: 100%; @@ -197,7 +204,7 @@ border-bottom: 1px solid hsl(var(--border) / 0.5); code { - color: hsl(var(--primary)); + color: var(--code-text); background: hsl(var(--secondary)); padding: 0.125rem 0.375rem; border-radius: 0.25rem; From c130007392cd231b496cb2240aa82183796955e0 Mon Sep 17 00:00:00 2001 From: Marko Stijak Date: Fri, 27 Nov 2026 10:12:34 +0100 Subject: [PATCH 2/4] docs: search on phones, Fira Code for code, cleaner search results - Phones: a search button in the docs header opens a full-width search panel - Code uses Fira Code, which was specified but never loaded, so it looked different on every system; ligatures are off so code reads as typed - List bullets and numbers are a visible muted gray in both themes - The clear button in the search box is centered - Search results no longer include the "On this page" box or the previous/next links in their excerpts --- homedocs/src/components/Header.astro | 92 +++++++++++++++++++++++- homedocs/src/components/OnThisPage.astro | 2 +- homedocs/src/components/PageNav.astro | 2 +- homedocs/src/layouts/BaseLayout.astro | 2 +- homedocs/src/styles/global.scss | 10 +++ homedocs/src/styles/pagefind.scss | 53 ++++++++++++-- homedocs/src/styles/prose.scss | 11 +++ 7 files changed, 164 insertions(+), 8 deletions(-) diff --git a/homedocs/src/components/Header.astro b/homedocs/src/components/Header.astro index 759172f40..7f86db734 100644 --- a/homedocs/src/components/Header.astro +++ b/homedocs/src/components/Header.astro @@ -62,13 +62,28 @@ const currentCategory = getCurrentCategory(pathname);
+ + + +