diff --git a/site/pages/blank.mdx b/site/pages/blank.mdx new file mode 100644 index 00000000..ae9df737 --- /dev/null +++ b/site/pages/blank.mdx @@ -0,0 +1,8 @@ +--- +outline: false +# sidebar: false +--- + +# Blank page + +This is a blank page. \ No newline at end of file diff --git a/src/app/components/DesktopTopNav.css.ts b/src/app/components/DesktopTopNav.css.ts index a3fca8da..56554a91 100644 --- a/src/app/components/DesktopTopNav.css.ts +++ b/src/app/components/DesktopTopNav.css.ts @@ -1,7 +1,9 @@ import { style } from '@vanilla-extract/css' +import { leftGutterWidthVar } from '../layouts/DocsLayout.css.js' import { borderRadiusVars, primitiveColorVars, + sidebarVars, spaceVars, topNavVars, viewportVars, @@ -69,6 +71,27 @@ export const icon = style( export const item = style({ alignItems: 'center', display: 'flex', height: '100%' }, 'item') +export const logo = style( + { + paddingLeft: sidebarVars.horizontalPadding, + paddingRight: sidebarVars.horizontalPadding, + width: sidebarVars.width, + }, + 'logo', +) + +export const logoWrapper = style( + { + display: 'flex', + height: '100%', + justifyContent: 'flex-end', + left: 0, + position: 'absolute', + width: leftGutterWidthVar, + }, + 'logoWrapper', +) + export const section = style( { alignItems: 'center', display: 'flex', height: '100%', gap: spaceVars[16] }, 'section', diff --git a/src/app/components/DesktopTopNav.tsx b/src/app/components/DesktopTopNav.tsx index f9c0517c..1c6ed92e 100644 --- a/src/app/components/DesktopTopNav.tsx +++ b/src/app/components/DesktopTopNav.tsx @@ -6,6 +6,7 @@ import { useTheme } from '../hooks/useTheme.js' import { visibleDark, visibleLight } from '../styles/utils.css.js' import * as styles from './DesktopTopNav.css.js' import { Icon } from './Icon.js' +import { Logo } from './Logo.js' import { Discord } from './icons/Discord.js' import { GitHub } from './icons/GitHub.js' import { Moon } from './icons/Moon.js' @@ -18,6 +19,11 @@ export function DesktopTopNav() { const config = useConfig() return (
+
+
+ +
+
{config.socials && ( diff --git a/src/app/components/Logo.css.ts b/src/app/components/Logo.css.ts new file mode 100644 index 00000000..c0713349 --- /dev/null +++ b/src/app/components/Logo.css.ts @@ -0,0 +1,29 @@ +import { globalStyle, style } from '@vanilla-extract/css' +import { fontSizeVars, fontWeightVars, lineHeightVars } from '../styles/vars.css.js' + +export const logoImage = style( + { + height: '30%', + width: 'max-content', + }, + 'logoImage', +) + +export const logoDark = style({}, 'logoDark') +globalStyle(`:root:not(.dark) ${logoDark}`, { + display: 'none', +}) + +export const logoLight = style({}, 'logoLight') +globalStyle(`:root.dark ${logoLight}`, { + display: 'none', +}) + +export const title = style( + { + fontSize: fontSizeVars['18'], + fontWeight: fontWeightVars.semibold, + lineHeight: lineHeightVars.heading, + }, + 'title', +) diff --git a/src/app/components/Logo.tsx b/src/app/components/Logo.tsx new file mode 100644 index 00000000..77c39ece --- /dev/null +++ b/src/app/components/Logo.tsx @@ -0,0 +1,35 @@ +import clsx from 'clsx' +import { Link } from 'react-router-dom' + +import { useConfig } from '../hooks/useConfig.js' +import * as styles from './Logo.css.js' + +export function Logo() { + const config = useConfig() + return ( + + {config.logoUrl ? ( + <> + {typeof config.logoUrl === 'string' ? ( + Logo + ) : ( + <> + Logo + Logo + + )} + + ) : ( +
{config.title}
+ )} + + ) +} diff --git a/src/app/components/Sidebar.css.ts b/src/app/components/Sidebar.css.ts index 0c4d0824..0a51b9bc 100644 --- a/src/app/components/Sidebar.css.ts +++ b/src/app/components/Sidebar.css.ts @@ -22,6 +22,15 @@ export const root = style({ }, }) +export const divider = style( + { + backgroundColor: primitiveColorVars.border, + width: '100%', + height: '1px', + }, + 'divider', +) + export const item = style( { color: primitiveColorVars.text3, @@ -52,36 +61,23 @@ export const items = style( export const logo = style( { alignItems: 'center', - borderBottom: `1px solid ${primitiveColorVars.border}`, display: 'flex', height: topNavVars.height, - '@media': { - 'screen and (max-width: 1080px)': { - display: 'none', - }, - }, }, 'logo', ) -export const logoImage = style( +export const logoWrapper = style( { - height: '30%', - width: 'max-content', + '@media': { + 'screen and (max-width: 1080px)': { + display: 'none', + }, + }, }, - 'logoImage', + 'logoWrapper', ) -export const logoDark = style({}, 'logoDark') -globalStyle(`:root:not(.dark) ${logoDark}`, { - display: 'none', -}) - -export const logoLight = style({}, 'logoLight') -globalStyle(`:root.dark ${logoLight}`, { - display: 'none', -}) - export const navigation = style( { selectors: { @@ -151,12 +147,3 @@ export const socials = style( }, 'socials', ) - -export const title = style( - { - fontSize: fontSizeVars['18'], - fontWeight: fontWeightVars.semibold, - lineHeight: lineHeightVars.heading, - }, - 'title', -) diff --git a/src/app/components/Sidebar.tsx b/src/app/components/Sidebar.tsx index 9d17f5a5..aeb260d3 100644 --- a/src/app/components/Sidebar.tsx +++ b/src/app/components/Sidebar.tsx @@ -5,6 +5,7 @@ import { Link, useMatch } from 'react-router-dom' import type { ParsedSocialItem } from '../../config.js' import { useConfig } from '../hooks/useConfig.js' import { Icon } from './Icon.js' +import { Logo } from './Logo.js' import * as styles from './Sidebar.css.js' import { Discord } from './icons/Discord.js' import { GitHub } from './icons/GitHub.js' @@ -20,31 +21,13 @@ export function Sidebar({ if (!sidebar) return null return (