diff --git a/docusaurus.config.ts b/docusaurus.config.ts index d9fd735..96f7695 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -301,7 +301,7 @@ const config: Config = { ], }, footer: { - style: 'dark', + style: 'light', links: [ { title: 'Documentation', @@ -358,8 +358,9 @@ const config: Config = { copyright: `Copyright © ${new Date().getFullYear()} Companion. Built with Docusaurus.`, }, prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, + // Backgrounds match --companion-surface-muted (src/css/companion-tokens.css); Prism sets them inline, so CSS can't + theme: { ...prismThemes.github, plain: { ...prismThemes.github.plain, backgroundColor: '#f0f0f0' } }, + darkTheme: { ...prismThemes.vsDark, plain: { ...prismThemes.vsDark.plain, backgroundColor: '#202020' } }, }, } satisfies Preset.ThemeConfig, } diff --git a/for-developers/module-development/local-modules.md b/for-developers/module-development/local-modules.md index 074eb3e..7f459c7 100644 --- a/for-developers/module-development/local-modules.md +++ b/for-developers/module-development/local-modules.md @@ -1,6 +1,7 @@ --- title: Setting up the Development Folder -sidebar_label: '└─ Setting up a Dev Folder' +sidebar_label: 'Setting up a Dev Folder' +sidebar_class_name: sidebar-subitem sidebar_position: 2 description: How to load modules in Companion during module development. --- diff --git a/for-developers/setting-up-WSL.md b/for-developers/setting-up-WSL.md index ff03617..93f27fa 100644 --- a/for-developers/setting-up-WSL.md +++ b/for-developers/setting-up-WSL.md @@ -1,6 +1,7 @@ --- title: Setting Up WSL for the Developer Environment -sidebar_label: '└─ WSL Setup Notes' +sidebar_label: 'WSL Setup Notes' +sidebar_class_name: sidebar-subitem sidebar_position: 1.1 description: How to set up Windows System for Linux (WSL) for Companion development --- diff --git a/package.json b/package.json index 43044b6..7ae605f 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "dependencies": { "@docusaurus/core": "3.10.2", "@docusaurus/preset-classic": "3.10.2", + "@fontsource-variable/inter": "^5.3.0", + "@fontsource/fira-code": "^5.3.0", "@mdx-js/react": "^3.1.1", "clsx": "^2.1.1", "prism-react-renderer": "^2.4.1", diff --git a/src/components/HeroButtons.module.css b/src/components/HeroButtons.module.css index 8d7395c..f614da1 100644 --- a/src/components/HeroButtons.module.css +++ b/src/components/HeroButtons.module.css @@ -13,7 +13,8 @@ } .primaryButton { - background-color: #2563eb; + /* The light-theme brand red in both themes; the dark-theme red is too light for white text. */ + background-color: #d50215; color: white; padding: 0.75rem 1.5rem; /* stack label + subtitle vertically */ @@ -31,14 +32,14 @@ } .primaryButton:hover { - background-color: #1d4ed8; + background-color: rgb(170, 2, 17); color: white; text-decoration: none; } .secondaryButton { - background-color: #f3f4f6; - color: #374151; + background-color: var(--companion-surface); + color: var(--companion-body-text); padding: 0.75rem 1.5rem; display: inline-flex; align-items: center; @@ -47,27 +48,15 @@ border-radius: 0.375rem; text-decoration: none; font-weight: 500; - border: 1px solid #d1d5db; + border: 1px solid var(--companion-border-medium); transition: all 0.2s; } .secondaryButton:hover { - background-color: #e5e7eb; - color: #374151; + background-color: var(--companion-action-hover); + color: var(--companion-text-strong); text-decoration: none; - border-color: #9ca3af; -} - -[data-theme='dark'] .secondaryButton { - background-color: #374151; - color: #f9fafb; - border-color: #4b5563; -} - -[data-theme='dark'] .secondaryButton:hover { - background-color: #4b5563; - color: #f9fafb; - border-color: #6b7280; + border-color: var(--companion-action-focus); } /* Small subtitle text inside a button (e.g. "Win / Mac / Linux") */ diff --git a/src/css/companion-tokens.css b/src/css/companion-tokens.css new file mode 100644 index 0000000..317e1c8 --- /dev/null +++ b/src/css/companion-tokens.css @@ -0,0 +1,44 @@ +/* Copy of bitfocus/companion `shared-lib/theme/tokens.css`, which the Companion UI and its bundled user guide share. + Keep the values in step with that file so the website matches the in-app docs. */ +:root { + --companion-font-sans: + 'Inter Variable', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', + 'Noto Color Emoji'; + --companion-font-mono: 'Fira Code', ui-monospace, monospace; + + --companion-brand: #d50215; + --companion-brand-hover: rgb(170, 2, 17); + --companion-accent-active: #941d1b; + --companion-app-frame-bg: #f3f4f7; + --companion-app-bg: #f9f9f9; + --companion-surface: #fff; + --companion-surface-muted: #f0f0f0; + --companion-border: #ddd; + --companion-border-medium: #bbb; + --companion-text-strong: #000; + --companion-body-text: rgba(37, 42.92, 54.02, 0.95); + --companion-text-secondary: #666; + --companion-selection-bg: #e5e8eb; + --companion-selection-text: #303842; + --companion-action-hover: #e8ebee; + --companion-action-focus: #66788a; +} + +:root[data-theme='dark'] { + --companion-brand: #f0444f; + --companion-brand-hover: #ff6b74; + --companion-accent-active: #e0434a; + --companion-app-frame-bg: #0e0e0e; + --companion-app-bg: #131313; + --companion-surface: #181818; + --companion-surface-muted: #202020; + --companion-border: #303030; + --companion-border-medium: #4b4b4b; + --companion-text-strong: #fff; + --companion-body-text: #dfdfdf; + --companion-text-secondary: #a9a9a9; + --companion-selection-bg: #303030; + --companion-selection-text: #e3e3e3; + --companion-action-hover: #2f2f2f; + --companion-action-focus: #999999; +} diff --git a/src/css/custom.css b/src/css/custom.css index 517ce3a..6a51b2f 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -1,276 +1,419 @@ -/** - * Any CSS included here will be global. The classic template - * bundles Infima by default. Infima is a CSS framework designed to - * work well for content-centric websites. - */ +/* Styling follows bitfocus/companion `docs/src/css/custom.css` (the user guide bundled in the app) so the website and + the in-app docs look the same. Website-only parts (navbar tabs, Algolia search, landing pages) are marked below. */ +@import './companion-tokens.css'; +@import '@fontsource-variable/inter/wght.css'; +@import '@fontsource-variable/inter/wght-italic.css'; +@import '@fontsource/fira-code/400.css'; +@import '@fontsource/fira-code/500.css'; +@import '@fontsource/fira-code/600.css'; +@import '@fontsource/fira-code/700.css'; + +:root, +:root[data-theme='dark'] { + --ifm-color-primary: var(--companion-brand); + --ifm-link-hover-color: var(--companion-brand-hover); + --ifm-color-content: var(--companion-body-text); + --ifm-color-content-secondary: var(--companion-text-secondary); + --ifm-heading-color: var(--companion-text-strong); + --ifm-background-color: var(--companion-app-bg); + --ifm-background-surface-color: var(--companion-surface); + --ifm-font-family-base: var(--companion-font-sans); + --ifm-font-family-monospace: var(--companion-font-mono); + --ifm-code-font-size: 95%; + --ifm-code-background: var(--companion-surface-muted); + --ifm-global-radius: 0.5rem; + --ifm-hover-overlay: var(--companion-action-hover); + --ifm-navbar-height: 3.25rem; + --ifm-navbar-background-color: var(--companion-app-frame-bg); + --ifm-navbar-link-color: var(--companion-body-text); + --ifm-navbar-link-hover-color: var(--companion-text-strong); + --ifm-navbar-search-input-background-color: var(--companion-surface); + --ifm-navbar-search-input-color: var(--companion-body-text); + --ifm-navbar-search-input-placeholder-color: var(--companion-text-secondary); + --ifm-menu-color: var(--companion-body-text); + --ifm-menu-color-active: var(--companion-selection-text); + --ifm-menu-color-background-active: var(--companion-selection-bg); + --ifm-breadcrumb-color-active: var(--companion-selection-text); + --ifm-breadcrumb-item-background-active: var(--companion-selection-bg); + --ifm-breadcrumb-border-radius: var(--ifm-global-radius); + --ifm-toc-border-color: var(--companion-border); + --ifm-table-border-color: var(--companion-border); + --ifm-table-stripe-background: var(--companion-surface-muted); + --docusaurus-highlighted-code-line-bg: var(--companion-selection-bg); + + --companion-log-sample-bg: var(--companion-surface-muted); + + /* Website only: Algolia DocSearch */ + --docsearch-primary-color: var(--companion-brand); + --docsearch-text-color: var(--companion-body-text); + --docsearch-muted-color: var(--companion-text-secondary); + --docsearch-icon-color: var(--companion-text-secondary); + --docsearch-focus-color: var(--companion-action-focus); + --docsearch-search-button-background: var(--companion-surface); + --docsearch-search-button-text-color: var(--companion-text-secondary); + --docsearch-searchbox-background: var(--companion-surface); + --docsearch-searchbox-focus-background: var(--companion-surface); + --docsearch-modal-background: var(--companion-app-bg); + --docsearch-footer-background: var(--companion-app-frame-bg); + --docsearch-hit-background: var(--companion-surface); + --docsearch-hit-color: var(--companion-body-text); + --docsearch-key-background: var(--companion-surface-muted); + --docsearch-key-color: var(--companion-text-secondary); + --docsearch-border-radius: var(--ifm-global-radius); + --docsearch-soft-primary-color: var(--companion-selection-bg); + --docsearch-highlight-color: var(--companion-brand); + --docsearch-hit-highlight-color: var(--companion-selection-bg); + --docsearch-secondary-text-color: var(--companion-text-secondary); + --docsearch-subtle-color: var(--companion-border); + --docsearch-background-color: var(--companion-surface-muted); + --docsearch-muted-color-darker: var(--companion-border-medium); + --docsearch-logo-color: var(--companion-text-secondary); + --docsearch-container-background: rgb(0 0 0 / 60%); + --docsearch-footer-shadow: 0 -1px 0 0 var(--companion-border); + --docsearch-modal-shadow: 0 12px 28px rgb(0 0 0 / 30%), 0 0 0 1px var(--companion-border); + --docsearch-key-pressed-shadow: inset 0 2px 4px rgb(0 0 0 / 25%); +} + +/* Infima doesn't derive these from --ifm-color-primary; without them buttons and other states fall back to its blue. */ +:root { + --ifm-color-primary-dark: #c00213; + --ifm-color-primary-darker: #b50212; + --ifm-color-primary-darkest: #95010f; + --ifm-color-primary-light: #ea0217; + --ifm-color-primary-lighter: #f50218; + --ifm-color-primary-lightest: #fd1b2f; +} -/* Adjust anchor-linking (in-page links) behavior: animate scrolling down to them - and if the screen is tall enough, show a bit above the link for context. */ -@media (prefers-reduced-motion: no-preference) { - html { - scroll-behavior: smooth; - } +:root[data-theme='dark'] { + --ifm-color-primary-dark: #ee2734; + --ifm-color-primary-darker: #ed1927; + --ifm-color-primary-darkest: #c8101c; + --ifm-color-primary-light: #f2616a; + --ifm-color-primary-lighter: #f36f77; + --ifm-color-primary-lightest: #f79aa0; } -@media (min-height: 600px) { - html { - scroll-padding-top: 2rem; - } +:focus-visible { + outline: 2px solid var(--companion-action-focus); + outline-offset: 2px; } -/* You can override the default Infima variables here. */ -:root { - --ifm-color-primary: #d50215; - --ifm-color-primary-dark: #bf0213; - --ifm-color-primary-darker: #b40212; - --ifm-color-primary-darkest: #94010f; - --ifm-color-primary-light: #e00217; - --ifm-color-primary-lighter: #e60c22; - --ifm-color-primary-lightest: #ea2336; - --ifm-code-font-size: 95%; - --docusaurus-highlighted-code-line-bg: rgb(0 0 0 / 10%); - - --companion-navbar-bg: #d50215; - --ifm-navbar-height: 3.25rem; /* default is 3.75 */ - --ifm-navbar-background-color: var(--companion-navbar-bg); - --ifm-navbar-link-color: white; - --ifm-navbar-link-hover-color: white; - - --companion-navbar-item-hover-bg: rgb(255 255 255 / 20%); - --companion-active-tab-color: var(--ifm-font-color-base); - --companion-active-tab-bg: white; - --companion-active-tab-shadow-color: rgb(0 0 0 / 10%); - --companion-mode-toggle-bg: rgb(255 255 255 / 40%); - --companion-group-border-color: rgb(0 0 0 / 10%); - --companion-pulldown-sidebar-bg: white; /* --ifm-background-color is transparent in light mode */ - --companion-log-sample-bg: #f2f2f2; -} - -/* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-color-primary: #f04d63; - --ifm-color-primary-dark: #ed3249; - --ifm-color-primary-darker: #eb233e; - --ifm-color-primary-darkest: #d30825; - --ifm-color-primary-light: #f3687d; - --ifm-color-primary-lighter: #f47788; - --ifm-color-primary-lightest: #f89aa7; - - --docusaurus-highlighted-code-line-bg: rgb(0 0 0 / 30%); - --ifm-navbar-link-color: white; - --ifm-navbar-link-hover-color: white; - - --companion-active-tab-color: var(--ifm-font-color-base); /* for the pseudo-tab links in the top navbar */ - --companion-active-tab-bg: var(--ifm-background-color); /* #1b1b1d */ - --companion-active-tab-shadow-color: rgb(125 125 125 / 10%); - --companion-mode-toggle-bg: rgb(0 0 0 / 25%); - --companion-group-border-color: rgb(255 255 255 / 10%); - --companion-pulldown-sidebar-bg: var(--ifm-background-color); - --companion-log-sample-bg: #2e2f31; -} - -/* parent of the "tabs" needs slight adjustments: */ -/* The navbar and (implicitly) right container must not hide overflow: or the version dropdown will be clipped. */ .navbar { - padding-top: 0; /* In order to enable tab-like visuals, we need to let the inner elements deal with padding. */ - padding-bottom: 0; - box-shadow: none; /* keeps tab continuous with page content */ + border-bottom: 1px solid var(--companion-border); + box-shadow: none; +} + +.navbar__inner, +.navbar__items { + min-width: 0; } -/* To get the best tab effect clip overflow so we don't have to precisely calculate the button padding. - This also prevents the shadow from interrupting the continuity of the tab to the page contents */ -.theme-layout-navbar-left { - overflow: hidden; +/* Website only: keep the hover/active backgrounds of neighbouring links from touching */ +.navbar__items { + gap: 0.25rem; } -/* Navbar (the top bar, not the sidebar) link styles - note: `overflow: hidden;` can cause weird text-wrapping (if wrapping is enabled). It clips button text when wrapping is disabled. - Note: The margin-bottom/border-bottom adjustment here is made large to make the tabs touch the bottom of the header bar - Since we're clipping the left-container, the bottom-border needn't be precise -- as long as it's big enough. - note 3: ":not(:last-child)" is to prevent tab-highlighting in the app-packaged docs, where there are no tabs. - */ +.navbar__brand { + min-width: 0; + font-size: 0.9375rem; +} + +.navbar__logo { + height: 1.75rem; +} + +.navbar__title { + font-weight: 600; +} + +.navbar__item.navbar__link, +.navbar__toggle, +.navbar-sidebar__close { + border-radius: var(--ifm-global-radius); + + &:hover { + background-color: var(--companion-action-hover); + } +} + +.navbar__toggle, +.navbar-sidebar__close { + color: var(--companion-body-text); +} + +.navbar__toggle { + padding: 0.25rem; +} + +/* Website only: the section links (User Guide, What's New, ...) on the left of the navbar */ .theme-layout-navbar-left .navbar__link { - --vertical-padding: 0.5rem; /* make up for the reduced line-height */ - --margin-bottom: calc(-1 * var(--ifm-navbar-height) / 2); /* move the button down to create the tab-like effect */ - text-align: center; /* keep labels horizontally centered when they become two lines */ - line-height: 1; /* keep labels compact when words wrap to two lines (in case we remove nowrap later, below) */ - padding-top: var(--vertical-padding); - padding-bottom: calc( - var(--vertical-padding) - var(--margin-bottom) - ); /* note that margin-bottom is negative, so padding-bottom is positive and larger in magnitude */ - margin-bottom: var(--margin-bottom); - white-space: nowrap; /* Prevent two-line buttons! If we add more buttons, this may be removed */ - - /* Make page-tab links with rounded top corners, but square bottom corners so it visually "fuses" with the page */ - border-radius: 0.5rem 0.5rem 0 0; -} - -/* Make the active link look a like a page-tab (like a browser tab or VS Code editor tabs) */ + white-space: nowrap; +} + .theme-layout-navbar-left .navbar__link--active { - color: var(--companion-active-tab-color); - background-color: var(--companion-active-tab-bg); - /* Give the tab a glow */ - box-shadow: 0 -4px 10px 1px var(--companion-active-tab-shadow-color); + color: var(--companion-selection-text); + background-color: var(--companion-selection-bg); + font-weight: 600; +} + +/* Website only: Algolia DocSearch button in the navbar */ +.DocSearch-Button { + height: 2rem; + border: 1px solid var(--companion-border-medium); + border-radius: var(--ifm-global-radius); + font: inherit; + font-size: 0.8125rem; - .navbar__title { - font-weight: var(--ifm-font-weight-semibold); /* for the logo, match other tabs; bold is too strong */ + &:hover { + border-color: var(--companion-action-focus); + box-shadow: none; } } -/* Hover styles for navbar links. - Note: ".navbar__item.navbar__link" excludes dropdown menus, which by default do not highlight, possibly due to dropdown--hoverable - */ -.navbar__item.navbar__link:hover:not(.navbar__link--active), -.navbar__toggle:hover { - background-color: var(--companion-navbar-item-hover-bg); +/* Website only: the DocSearch modal's search field */ +.DocSearch-Modal { + --docsearch-actions-width: auto; } -.navbar__brand:hover, -.navbar-sidebar__close:hover { - opacity: 85%; +.DocSearch-Input { + padding-inline-start: 0.75rem; + font-weight: 400; + + /* The site-wide focus ring would cut through the magnifier; the modal only has this one field anyway */ + &:focus-visible { + outline: none; + } } -/* Make the dark/light mode button stand out better. - Unfortunately, it doesn't have a non-serialized classname, but this works. - Can't say if it's better than .clean-btn[title='system mode'], but it's safer from localization */ -.theme-layout-navbar-right .clean-btn:not(:hover), -.navbar-sidebar__brand .clean-btn:not(:hover) { - background-color: var(--companion-mode-toggle-bg); +.DocSearch-Form:focus-within .DocSearch-MagnifierLabel svg { + color: var(--companion-body-text); } -/* The next two rules adjust spacing for the download, github and light/dark buttons. - The first is for the light/dark button when it is grouped with the other two, so only needs to work on the full navbar. */ -.theme-layout-navbar-right .clean-btn { - margin: 0 0.25em; +.DocSearch-Clear { + height: 1.75rem; + margin-inline-start: 0; + padding: 0 0.5rem; + border-radius: var(--ifm-global-radius); + color: var(--companion-text-secondary); + font-size: 0.8125rem; + font-weight: 400; + + &:hover { + background-color: var(--companion-action-hover); + color: var(--companion-text-strong); + } } -/* when the window is wide, the icons show in the right-header. Don't show text. */ -.theme-layout-navbar-right .navbar__link { - padding: 0.25em; - border-radius: 0.5rem; +/* The Algolia logo sets its own blue fill inside the SVG; show it in one colour like the rest of the modal */ +.DocSearch-Logo svg [class^='cls-'] { + fill: currentColor; +} + +@media (max-width: 996px) { + .navbar { + --ifm-navbar-padding-horizontal: 0.75rem; + } +} + +@media (max-width: 420px) { + .navbar__brand { + font-size: 0.8125rem; + } + + .navbar__logo { + height: 1.5rem; + } +} + +.theme-layout-navbar-right > .fontawesome-container { + padding: 0.45rem; - /* fontawesome-* classes are added in the item definitions in docusaurus.config.ts */ .fontawesome { - height: 2rem; + display: block; width: auto; - display: block; /* removes extra spacing below the SVG */ + height: 1.125rem; } + .fontawesome-text { display: none; } } -/* .navbar-sidebar__items: when the window is narrow, the right-header icons are in the pull-down sidebar - .navbar__inner .dropdown__menu: for dropdown menus in the navbar. (note, though, that the current design does not allow dropdowns in the left section.) - */ .navbar-sidebar__items, .navbar__inner .dropdown__menu { - /* fontawesome-* classes were added in the item definitions in docusaurus.config.ts */ .fontawesome-container { display: flex; align-items: center; + gap: 0.5rem; .fontawesome { - height: 1.5em; width: auto; - /* "display: block" not needed here — flex container eliminates the inline spacing below the SVG */ + height: 1.125rem; + } + } +} + +.navbar-sidebar, +.theme-doc-sidebar-container { + background-color: var(--companion-surface-muted); +} + +.navbar-sidebar__brand { + background-color: var(--companion-app-frame-bg); + border-bottom: 1px solid var(--companion-border); + box-shadow: none; +} + +.theme-doc-sidebar-container .menu { + padding-inline-end: 0.5rem; +} + +.theme-doc-sidebar-menu, +.navbar-sidebar .menu { + --ifm-menu-link-padding-vertical: 0.4rem; + font-size: 0.875rem; + + .menu__list .menu__list { + margin-inline-start: 0.75rem; + padding-inline-start: 0.5rem; + border-inline-start: 1px solid var(--companion-border); + } + + .menu__list-item-collapsible > .menu__link--active:not([aria-current='page']) { + color: var(--ifm-menu-color); + font-weight: 600; + } + + .menu__link[aria-current='page'] { + position: relative; + background-color: var(--companion-selection-bg); + font-weight: 600; + + &::before { + position: absolute; + inset-block: 0.4rem; + inset-inline-start: 0; + width: 3px; + border-radius: 2px; + background-color: var(--companion-accent-active); + content: ''; } + } + + /* Website only: a page shown as a child of the page above it (set with `sidebar_class_name` in its frontmatter) */ + .sidebar-subitem { + margin-inline-start: 0.75rem; + padding-inline-start: 0.5rem; + border-inline-start: 1px solid var(--companion-border); + } - .fontawesome-text { - line-height: 1; - padding-left: 0.5em; + /* Style the immediate groups in Configuration GUI using the bundled sidebar markup. */ + .theme-doc-sidebar-item-category:has(> .menu__list-item-collapsible > a[href$='/category/configuration-gui']) + > .menu__list + > .theme-doc-sidebar-item-category { + margin-block-start: 0.75rem; + + > .menu__list-item-collapsible > .menu__link { + color: var(--companion-text-secondary); + font-size: 0.75rem; + font-weight: 600; } } } -/* Default color for the sidebar toggle is black in light mode and grey in dark mode for some reason; neither look great */ -.navbar__toggle { - color: white; - padding: 0.5em; - border-radius: 0.5em; +.footer { + --ifm-footer-background-color: var(--companion-app-frame-bg); + --ifm-footer-color: var(--companion-text-secondary); + --ifm-footer-link-color: var(--companion-body-text); + --ifm-footer-link-hover-color: var(--companion-brand); + --ifm-footer-title-color: var(--companion-text-strong); + border-top: 1px solid var(--companion-border); +} + +/* Website only: admonitions and the version banner sit on the page surface with a coloured accent, not a tinted fill */ +.alert { + --companion-alert-accent: var(--companion-text-secondary); + --ifm-alert-background-color: var(--companion-surface); + --ifm-alert-background-color-highlight: var(--companion-surface-muted); + --ifm-alert-foreground-color: var(--companion-body-text); + --ifm-alert-border-color: var(--companion-border); + --ifm-alert-border-width: 1px; + --ifm-alert-border-left-width: 3px; + --ifm-alert-shadow: none; + border-inline-start-color: var(--companion-alert-accent); + + &.theme-admonition { + [class*='admonitionHeading'] { + color: var(--companion-alert-accent); + } + + [class*='admonitionIcon'] svg { + fill: var(--companion-alert-accent); + } + } } -/* when window is narrow, the "pull-down" sidebar's class is .navbar-sidebar. - Adjust its colors here to match the body/sidebar colors rather than the (top) navbar colors - (when the window is wider, the permanent sidebar class is .theme-doc-sidebar-menu) - */ -.navbar-sidebar { - --ifm-navbar-background-color: var(--companion-pulldown-sidebar-bg); +/* Light-mode accents also colour the small admonition headings, so keep them at 4.5:1 or better on white */ +.alert--success { + --companion-alert-accent: #1a7d37; } -/* the top of the narrow-win sidebar should be red regardless of theme */ -.navbar-sidebar__brand, -.navbar-sidebar__brand:hover { - background-color: var(--companion-navbar-bg); +.alert--info { + --companion-alert-accent: var(--companion-action-focus); } -/* Close-icon for the drop-down sidebar when the window is narrow */ -.navbar-sidebar__close { - padding: 0.5em; - border-radius: 0.5em; - color: white; /* doesn't do anything currently, because the SVG is hardcoded to: */ - --ifm-color-emphasis-600: white; +.alert--warning { + --companion-alert-accent: #966300; +} - &:hover { - background-color: var(--companion-mode-toggle-bg); - } +.alert--danger { + --companion-alert-accent: var(--companion-brand); } -/* For all sidebars: Make subgroup (aka category) boundaries more distinct. - note that the DOM for collapsing lists in the sidebar is: - - but the class .menu__list-item--collapsed is removed from the outer
  • and not - replaced by another classname, the condition for open is therefore: - .theme-doc-sidebar-item-category:not(.menu__list-item--collapsed) - */ +:root[data-theme='dark'] { + .alert--success { + --companion-alert-accent: #4cc46f; + } -.theme-doc-sidebar-item-category:not(.menu__list-item--collapsed) { - box-shadow: 1px 0 16px -3px var(--companion-group-border-color); - border-right: 1px solid var(--companion-group-border-color); - border-radius: 0.5rem; + .alert--warning { + --companion-alert-accent: #e0a82e; + } } -/* move the expand/contract caret to the far left for improved visibility/group offsetting. - The second class is active if the subdirectory has no linked-page (so clicking on it just opens the sublist w/o changing the main panel. - */ -.menu__caret, -.menu__link--sublist-caret::after { - order: -1; - padding-left: 0.45em; - padding-right: 0; - border-radius: 0.5rem 0 0 0.5rem; /* match the outer box's corner */ +.pagination-nav__link { + background-color: var(--companion-surface); + border-color: var(--companion-border); } -/* The caret is placed differently depending on whether the subdirectory has an index page. - The first is when an "index" is present; the second when there's no linked page */ -.menu__caret::before, -.menu__link--sublist-caret::after { - scale: 0.6; - margin-left: 0; /* this is currently needed for .menu__link--sublist-caret::after, but is correct for both */ +.pagination-nav__label { + color: var(--companion-text-strong); } -/* split the padding between the caret (previous rule) and the text in the category header */ -.menu__link--sublist { - padding-left: 0.2em; +.markdown :is(p, li) a { + text-decoration: underline; + text-underline-offset: 0.15em; } -/* indent sublists, i.e. list under a category, to align with the category header */ -.menu__list-item .menu__list-item { - margin-left: 0.35em; +.markdown img:is([src$='#themed-light'], [src$='#themed-dark'], [src$='#unthemed']) { + border: 1px solid var(--companion-border); + border-radius: var(--ifm-global-radius); } -/* Main body styling? CodeRabbit says these are safe to prune, but was there an intention to use these? */ -.text-gray-50 { - color: #f9fafb; +/* Adjust anchor-linking (in-page links) behavior: animate scrolling down to them + and if the screen is tall enough, show a bit above the link for context. */ +@media (prefers-reduced-motion: no-preference) { + html { + scroll-behavior: smooth; + } } -.text-gray-500 { - color: #6b7280; + +@media (min-height: 600px) { + html { + scroll-padding-top: 2rem; + } } -/* Auto-generated TOC heading links should be white, not red */ +/* Use the heading color on generated table-of-contents headings. */ .auto-toc-heading a { color: var(--ifm-heading-color); text-decoration: none; @@ -281,27 +424,13 @@ text-decoration: underline; } -/* In markdown pages indent all text, including subheaders, under H2 headers */ -.markdown h2 ~ :not(h1, h2) { - margin-left: 2rem; -} - -/* Some default numbers: in markdown, the ifm defaults are overridden - --ifm-heading-line-height: 1.25; - --ifm-h1-font-size: 2rem; but 3rem for top of file (.markdown h1:first-child), - --ifm-h2-font-size: 2rem; in markdown (default is 1.5 rem) - --ifm-h3-font-size: 1.5 in markdown; normal is 1.25rem; - --ifm-h4-font-size: 1rem; (unchanged) - --ifm-h5-font-size: 0.875rem; - --ifm-h6-font-size: 0.85rem; - */ .markdown h1 { --ifm-h1-vertical-rhythm-bottom: 1; font-size: 2em; /* setting --ifm-h1-font-size doesn't work (because of specificity?) */ } .markdown h2 { - --ifm-h2-vertical-rhythm-top: 1; /* default 2 is too much. Also, we already indent everything under H2 to make H2 breaks clear */ + --ifm-h2-vertical-rhythm-top: 1; --ifm-heading-vertical-rhythm-bottom: calc(0.5 / 1.25); /* this is multiplied by --ifm-leading = 1.25 */ font-size: 1.5em; } @@ -310,7 +439,7 @@ font-size: 1.25em; } -/* The following rule centers images on their own line. +/* The following rule centers images on their own line. The reason for ":last-child" is to allow us to keep the image inline by placing an element after the image in the markdown document. */ .markdown img:last-child { @@ -339,12 +468,11 @@ margin-left: 4em; } -/* e.g. a small inline button such as the ⋮ menu. - Fixed light colours in both themes, since the Companion UI itself has no dark mode */ +/* e.g. a small inline button such as the ⋮ menu; follows the site theme like the Companion UI does */ .companion-ui-button { - background: #f2f2f2; - color: #212529; - border: 1px solid #cccccc; + background: var(--companion-surface-muted); + color: var(--companion-body-text); + border: 1px solid var(--companion-border-medium); border-radius: 5px; font-size: 0.8em; padding: 0.25em 0.75em; diff --git a/src/pages/landing.module.css b/src/pages/landing.module.css index 0a63ff3..9798948 100644 --- a/src/pages/landing.module.css +++ b/src/pages/landing.module.css @@ -1,21 +1,4 @@ /* Landing page specific styles */ -.openSourceBanner { - background-color: #f3f4f6; - padding: 0.5rem 1rem; - text-align: center; - font-size: 0.875rem; - color: #4b5563; -} - -.openSourceBanner a { - color: #1d4ed8; - text-decoration: underline; -} - -.openSourceBanner a:hover { - opacity: 0.8; -} - .heroSection { padding: 4rem 2rem 2rem; text-align: center; @@ -42,7 +25,7 @@ .featuresSection { padding: 2rem 2rem; - background-color: var(--ifm-background-color-subtle); + background-color: var(--companion-surface-muted); } .sectionContainer { @@ -50,50 +33,6 @@ margin: 0 auto; } -.sectionTitle { - font-size: 2.25rem; - line-height: 2.5rem; - font-weight: 600; - text-align: center; - color: var(--ifm-color-content); - margin-bottom: 3rem; - letter-spacing: -0.025em; -} - -.featuresGrid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - gap: 2rem; - margin-bottom: 3rem; -} - -.featureCard { - background: white; - padding: 2rem; - border-radius: 0.75rem; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); -} - -.featureTitle { - font-size: 1.25rem; - font-weight: 600; - color: #111827; - margin-bottom: 0.75rem; -} - -.featureDescription { - color: #4b5563; - line-height: 1.5; -} - -.videoContainer { - display: flex; - align-items: center; - justify-content: center; - background: #111827; - padding: 1rem; -} - .videoEmbed { width: 100%; aspect-ratio: 16/9; @@ -106,35 +45,10 @@ padding: 4rem 2rem; } -.benefitsList { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); - gap: 1.5rem; - margin-top: 2rem; -} - -.benefitItem { - display: flex; - align-items: flex-start; - gap: 0.75rem; -} - -.benefitIcon { - width: 1.25rem; - height: 1.25rem; - color: #059669; - margin-top: 0.125rem; - flex-shrink: 0; -} - -.benefitText { - color: #374151; - line-height: 1.5; -} - .githubSection { + --ifm-heading-color: white; padding: 4rem 2rem; - background-color: #111827; + background-color: #181818; color: white; text-align: center; } @@ -150,43 +64,24 @@ .githubDescription { font-size: 1.125rem; line-height: 1.75rem; - color: #d1d5db; + color: #dfdfdf; max-width: 42rem; margin: 0 auto 2rem auto; } -.githubButton { - background-color: #374151; - color: white; - padding: 0.75rem 1.5rem; - border-radius: 0.375rem; - text-decoration: none; - font-weight: 500; - display: inline-flex; - align-items: center; - gap: 0.5rem; - transition: background-color 0.2s; -} - -.githubButton:hover { - background-color: #4b5563; - color: white; - text-decoration: none; -} - /* Add class for the features and video container */ .featuresVideoContainer { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; - background: #111827; + background: #181818; border-radius: 0.75rem; color: white; overflow: hidden; } [data-theme='dark'] .featuresVideoContainer { - background: #1f2937; + background: #202020; } .featuresContent { @@ -197,12 +92,12 @@ display: flex; align-items: center; justify-content: center; - background: #111827; + background: #181818; padding: 1rem; } [data-theme='dark'] .videoContainer { - background: #1f2937; + background: #202020; } /* Responsive adjustments */ @@ -211,10 +106,6 @@ font-size: 2.25rem; } - .featuresGrid { - grid-template-columns: 1fr; - } - .featuresVideoContainer { grid-template-columns: 1fr; } diff --git a/yarn.lock b/yarn.lock index 6aab17a..d39a9d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2766,6 +2766,20 @@ __metadata: languageName: node linkType: hard +"@fontsource-variable/inter@npm:^5.3.0": + version: 5.3.0 + resolution: "@fontsource-variable/inter@npm:5.3.0" + checksum: 10c0/46fbe41e8482a718f99634c8254346c6081d615415059be12e177224c903d688199125967825e75d4b8122668fd83f70880e11d4e02d08c20b503c65fe2a96d1 + languageName: node + linkType: hard + +"@fontsource/fira-code@npm:^5.3.0": + version: 5.3.0 + resolution: "@fontsource/fira-code@npm:5.3.0" + checksum: 10c0/402416a8a645b4f7e5be72f223626a68c0a60fd836d5f7e8b840a07ed83637663abe70e8d05f88602225248df90bbd733807dab1e819aab65557e9fbdafed8d4 + languageName: node + linkType: hard + "@hapi/hoek@npm:^9.0.0, @hapi/hoek@npm:^9.3.0": version: 9.3.0 resolution: "@hapi/hoek@npm:9.3.0" @@ -5745,6 +5759,8 @@ __metadata: "@docusaurus/preset-classic": "npm:3.10.2" "@docusaurus/tsconfig": "npm:3.10.2" "@docusaurus/types": "npm:3.10.2" + "@fontsource-variable/inter": "npm:^5.3.0" + "@fontsource/fira-code": "npm:^5.3.0" "@mdx-js/react": "npm:^3.1.1" clsx: "npm:^2.1.1" prettier: "npm:3.9.10"