Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ After translation generation, run `npm run translations:polish`. The repository
checks verify all 20 public locales, canonical URLs, internal links, code
samples, and locale configuration.

### Front-end assets

Edit the numbered CSS sections in `fern/asset-source/css/`, the host and menu
sources in `fern/asset-source/js/`, and the customer-support sources in
`fern/asset-source/support/`. Language codes, display names, and widget aliases
are defined in `scripts/locale-config.mjs`.

Run `npm run assets:build` and include the resulting changes to `fern/styles.css`,
`fern/language-modal.js`, and `fern/support-widget.js`. Do not edit those
generated files directly. `npm run check` verifies that the artifacts match their
sources, and `npm run fern:dev` rebuilds them before starting the preview.

CSS files are concatenated in numeric order to preserve the existing cascade.
The JavaScript sources are built into the existing host and support scripts, so
the browser loads the same stylesheet and scripts in the same order.

## Validation

Use Node.js 22 to match CI (Node.js 20+ is required). Run validation before opening
Expand All @@ -57,6 +73,12 @@ npm run browser:check
The suite tests the custom UI in Chromium and WebKit with simulated Fern routing
and customer-support services. It does not publish or send production requests.

For changes tied to Fern's renderer, start `npm run fern:dev -- --port=3010`
and run `node tests/browser/preview-smoke.mjs` separately. It exercises real
preview routing, scrolling, a TOC jump and the theme control. The separate
`load-performance.mjs` and `scroll-performance.mjs --probe-toc-scope` scripts
sample public pages on demand; they are not required in CI.

## Content Standards

Good 6MM documentation should be:
Expand Down
46 changes: 46 additions & 0 deletions fern/asset-source/css/01-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* 6MM Fern Docs brand adjustments. Keep this small and let Fern own the UI. */
.fern-background-image {
background-image: none;
}

:root {
--sixmm-logo: #00ffda;
--sixmm-accent: #008f7d;
--sixmm-accent-strong: #00584d;
--sixmm-accent-soft: #e8fbf7;
--sixmm-accent-hover: #d7f7f1;
--sixmm-home-text: #0b0f17;
--sixmm-home-muted: #52626f;
--sixmm-home-border: rgba(15, 23, 42, 0.12);
--sixmm-home-surface: #ffffff;
--sixmm-home-soft: #f8fafb;
--sixmm-footer-shell: #f8fafb;
--sixmm-footer-item: #ffffff;
--sixmm-footer-divider: rgba(15, 23, 42, 0.12);
--sixmm-focus-ring: rgba(0, 143, 125, 0.28);
--sixmm-filled-hover: #00a891;
--sixmm-filled-text: #ffffff;
}

:root.dark {
--sixmm-accent: #00ffda;
--sixmm-accent-strong: #6fffe9;
--sixmm-accent-soft: rgba(0, 255, 218, 0.11);
--sixmm-accent-hover: rgba(0, 255, 218, 0.16);
--sixmm-home-text: #f7f8fb;
--sixmm-home-muted: #aeb9c2;
--sixmm-home-border: rgba(255, 255, 255, 0.16);
--sixmm-home-surface: #050706;
--sixmm-home-soft: #0b1110;
--sixmm-footer-shell: rgba(255, 255, 255, 0.07);
--sixmm-footer-item: #0b1110;
--sixmm-footer-divider: rgba(255, 255, 255, 0.16);
--sixmm-focus-ring: rgba(0, 255, 218, 0.42);
--sixmm-filled-hover: #32ffe5;
--sixmm-filled-text: #02110f;
}

#cs-widget-bubble:focus-visible {
outline: 3px solid var(--sixmm-accent-strong);
outline-offset: 4px;
}
12 changes: 12 additions & 0 deletions fern/asset-source/css/02-header.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions fern/asset-source/css/03-support-launcher.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#cs-widget-container iframe { background:var(--sixmm-home-surface); }
.sixmm-support-status { position:absolute; inset:0; z-index:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:24px; background:var(--sixmm-home-surface); color:var(--sixmm-home-text); text-align:center; }
.sixmm-support-status[hidden] { display:none; }
.sixmm-support-status p { margin:0; }
.sixmm-support-status button { border:1px solid var(--sixmm-home-border); border-radius:8px; padding:8px 16px; cursor:pointer; }
.sixmm-support-status button:focus-visible { outline:3px solid var(--sixmm-accent-strong); outline-offset:3px; }
.sixmm-support-spinner { width:28px; height:28px; border:3px solid var(--sixmm-home-border); border-top-color:var(--sixmm-accent); border-radius:50%; animation:sixmm-support-spin 1s linear infinite; }
.sixmm-support-status[data-state="error"] .sixmm-support-spinner { display:none; }
@keyframes sixmm-support-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .sixmm-support-spinner { animation:none; } }

.sixmm-support-launcher { position:fixed; z-index:999997; right:calc(24px + env(safe-area-inset-right, 0px)); bottom:calc(24px + env(safe-area-inset-bottom, 0px)); width:48px; height:48px; display:grid; place-items:center; border:0; border-radius:15px; background:var(--sixmm-accent); color:white; cursor:pointer; box-shadow:0 2px 8px #0002; }
.sixmm-support-launcher:focus-visible { outline:3px solid var(--sixmm-accent-strong); outline-offset:4px; }
.sixmm-support-launcher[aria-busy="true"] { opacity:.65; cursor:wait; }
24 changes: 24 additions & 0 deletions fern/asset-source/css/04-base-and-rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:root,
:root.dark {
accent-color: var(--sixmm-accent);
}

html,
body {
scrollbar-width: none;
-ms-overflow-style: none;
}

html[dir="rtl"] body {
direction: rtl;
}

html[dir="rtl"] :is(pre, code, kbd, samp, [data-language], [class*="code-block"]) {
direction: ltr;
text-align: left;
unicode-bidi: isolate;
}

html[dir="rtl"] article :is(input, textarea) {
direction: auto;
}
38 changes: 38 additions & 0 deletions fern/asset-source/css/05-hydration-notice.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.sixmm-hydration-notice {
position: fixed;
z-index: 1000000;
left: 16px;
right: 16px;
bottom: 16px;
margin: auto;
max-width: 620px;
padding: 14px 18px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
border: 1px solid #777;
border-radius: 12px;
background: #fff;
color: #171717;
font: 14px/1.5 system-ui, sans-serif;
box-shadow: 0 4px 24px #0003;
}

.dark .sixmm-hydration-notice {
background: #171717;
color: #fff;
}

.sixmm-hydration-notice button {
flex-shrink: 0;
padding: 8px 12px;
border: 1px solid currentColor;
border-radius: 6px;
cursor: pointer;
}

.sixmm-hydration-notice button:focus-visible {
outline: 2px solid currentColor;
outline-offset: 3px;
}
6 changes: 6 additions & 0 deletions fern/asset-source/css/06-page-scrollbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
html::-webkit-scrollbar,
body::-webkit-scrollbar {
width: 0;
height: 0;
display: none;
}
15 changes: 15 additions & 0 deletions fern/asset-source/css/07-support-loading.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
html.sixmm-support-widget-loading body::after {
position: fixed;
z-index: 999997;
right: calc(24px + env(safe-area-inset-right, 0px));
bottom: calc(24px + env(safe-area-inset-bottom, 0px));
width: 48px;
height: 48px;
border-radius: 15px;
background-color: var(--sixmm-accent);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14v-3a9 9 0 0 1 18 0v3'/%3E%3Crect x='1' y='13' width='4' height='7' rx='2' fill='white'/%3E%3Crect x='19' y='13' width='4' height='7' rx='2' fill='white'/%3E%3Cpath d='M21 18v1a3 3 0 0 1-3 3h-4'/%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
content: "";
pointer-events: none;
}
71 changes: 71 additions & 0 deletions fern/asset-source/css/08-navigation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#fern-sidebar-scroll-area {
scrollbar-color: var(--sixmm-accent) transparent !important;
}

#fern-sidebar-scroll-area::-webkit-scrollbar-thumb {
background: var(--sixmm-accent) !important;
background-color: var(--sixmm-accent) !important;
border-color: transparent !important;
border-radius: 999px;
}

#fern-sidebar-scroll-area::-webkit-scrollbar-track {
background: transparent !important;
}

a,
button,
[role="button"] {
text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
/* Inset focus keeps a single edge instead of adding a second outer frame. */
outline: 2px solid var(--sixmm-accent) !important;
outline-offset: -2px !important;
}

:is(header, nav, aside) :is(a, button, [role="button"]) {
transition: color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

:is(header, nav, aside) :is(a, button, [role="button"]):hover,
:is(header, nav, aside) :is(a, button, [role="button"]):focus-visible {
color: var(--sixmm-accent-strong) !important;
}

:is(header, nav, aside) :is(a, button, [role="button"]):hover svg,
:is(header, nav, aside) :is(a, button, [role="button"]):focus-visible svg {
color: var(--sixmm-accent) !important;
}

/* Fill the header in both legacy Fern and current Astro layouts so short
* locale labels stay centered and long translations can scroll horizontally. */
.fern-header-tabs > div:has(> [role="tablist"]),
.fern-header-tabs > astro-island > div:has(> [role="tablist"]) {
min-width: 0;
flex: 1 1 auto;
width: 100%;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
scrollbar-color: var(--sixmm-accent-strong) transparent;
}

.fern-header-tabs > div:has(> [role="tablist"])::-webkit-scrollbar,
.fern-header-tabs > astro-island > div:has(> [role="tablist"])::-webkit-scrollbar {
height: 5px;
}

.fern-header-tabs > div:has(> [role="tablist"])::-webkit-scrollbar-thumb,
.fern-header-tabs > astro-island > div:has(> [role="tablist"])::-webkit-scrollbar-thumb {
background: var(--sixmm-accent-strong);
border-radius: 5px;
}

.fern-header-tabs [role="tablist"] {
width: max-content;
margin-inline: auto;
}
Loading
Loading