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
33 changes: 33 additions & 0 deletions Docs/site/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,39 @@ th {
background: var(--ifm-color-warning);
}

/* The search plugin's dropdown is blue-grey with a solid primary bar on the selected hit. */
:root {
--search-local-modal-background: #f6f8f8;
--search-local-modal-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
--search-local-hit-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
--search-local-muted-color: var(--ifm-color-emphasis-600);
--search-local-hit-active-color: var(--ifm-font-color-base);
}
[data-theme='dark'] {
--search-local-modal-background: #162020;
--search-local-modal-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
/* Its module classes are hashed, so they are matched by prefix; the selected hit needs its own background, because the
plugin uses the highlight color for it and for the matched words alike. */
:root .navbar [class*='dropdownMenu_'] [class*='suggestion_'][class*='cursor_'] {
background: color-mix(in srgb, var(--ifm-color-primary) 14%, var(--search-local-modal-background));
}
/* The whole hit is the link, so neither the document icon nor the enter icon adds anything. */
.navbar [class*='dropdownMenu_'] :is([class*='hitIcon_'], [class*='hitAction_']) {
display: none;
}
/* The search page separates its results with a fixed light grey that glares in the dark theme. */
:root [class*='searchResultItem_'] {
border-bottom-color: var(--ifm-color-emphasis-200);
}
:root [class*='searchResultItemPath_'] {
margin-top: 0.125rem;
}
:root [class*='searchResultItem_'] mark {
background: color-mix(in srgb, var(--ifm-color-primary) 22%, transparent);
color: inherit;
}

/* The full weight suits the start page and page titles, but on every section heading of a long page it shouts. */
.markdown :is(h2, h3, h4) {
font-weight: 700;
Expand Down
36 changes: 36 additions & 0 deletions Docs/site/src/theme/NotFound/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Swizzled (ejected) NotFound content: instead of the stock dead end, it offers the pages most visitors look for.
*/
import React, {type ReactNode} from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import Heading from '@theme/Heading';
import type {Props} from '@theme/NotFound/Content';
import styles from './styles.module.css';

const destinations = [
{title: 'Getting started', text: 'Build your first coffee shop from scratch.', to: '/docs/getting-started'},
{title: 'Diagnostics', text: 'Every AWT diagnostic, with an example and a fix.', to: '/docs/diagnostics'},
{title: 'Benchmarks', text: 'Awaiten against MS.DI, Autofac, DryIoc and Simple Injector.', to: '/docs/benchmarks'},
];

export default function NotFoundContent({className}: Props): ReactNode {
return (
<main className={clsx('container margin-vert--xl', className)}>
<div className="row">
<div className="col col--6 col--offset-3">
<Heading as="h1">Page not found</Heading>
<p>This page does not exist, or it has moved. Continue with one of these, or use the search at the top.</p>
<div className={styles.destinations}>
{destinations.map((destination) => (
<Link key={destination.to} to={destination.to} className={styles.destination}>
<span className={styles.title}>{destination.title} →</span>
<span className={styles.text}>{destination.text}</span>
</Link>
))}
</div>
</div>
</div>
</main>
);
}
33 changes: 33 additions & 0 deletions Docs/site/src/theme/NotFound/Content/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.destinations {
display: flex;
flex-direction: column;
gap: 0.75rem;
margin-top: 2rem;
}

.destination {
display: flex;
flex-direction: column;
gap: 0.15rem;
padding: 0.9rem 1.25rem;
border: 1px solid var(--ifm-color-emphasis-200);
border-radius: 12px;
color: inherit;
transition: border-color 0.15s ease;
}

.destination:hover {
border-color: var(--ifm-color-primary);
color: inherit;
text-decoration: none;
}

.title {
font-weight: 700;
color: var(--ifm-color-primary);
}

.text {
font-size: 0.9rem;
color: var(--ifm-color-emphasis-700);
}
Loading