From cafdf14928d96886aeb2d7f9f2f1a9320b5155fb Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 24 Oct 2024 21:41:25 -0700 Subject: [PATCH 1/2] refactor nav files + tiny css fixes --- src/components/Header.astro | 2 +- src/components/icons.tsx | 47 ------------------- .../sidebars/nav}/NavCollapsible.astro | 2 +- .../navigation/sidebars/nav/Tree.astro | 2 +- .../sidebars/{Nav.astro => nav/index.astro} | 4 +- src/layouts/DocsLayout.astro | 2 +- src/styles/docs/nav/nav-tree.css | 10 +++- 7 files changed, 15 insertions(+), 54 deletions(-) rename src/components/{ => navigation/sidebars/nav}/NavCollapsible.astro (90%) rename src/components/navigation/sidebars/{Nav.astro => nav/index.astro} (85%) diff --git a/src/components/Header.astro b/src/components/Header.astro index 24942c4..e09ba42 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,7 +1,7 @@ --- import { ThemeSelect } from "@components/hooks/ThemeSwitch"; import { getTypeData } from "@config/io/generateTypeData"; -import Nav from "@components/navigation/sidebars/Nav.astro"; +import Nav from "@components/navigation/sidebars/nav/index.astro"; import TOC from "@components/navigation/sidebars/TOC.astro"; import type { TypeTOC } from "./navigation/sidebars/types"; import Search from "./navigation/Search.astro"; diff --git a/src/components/icons.tsx b/src/components/icons.tsx index d5a6c29..6be7fb3 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -94,53 +94,6 @@ export const MenuToX: VoidComponent<{ ); }; -export const ShevronSmallDown: VoidComponent<{ - class?: string; -}> = props => { - return ( - - Open - - - - - ); -}; - -export const CaretCircleRight: VoidComponent<{ - class?: string; -}> = props => { - return ( - - Open - - - ); -}; - export const Clipboard: VoidComponent<{ class?: string; }> = props => { diff --git a/src/components/NavCollapsible.astro b/src/components/navigation/sidebars/nav/NavCollapsible.astro similarity index 90% rename from src/components/NavCollapsible.astro rename to src/components/navigation/sidebars/nav/NavCollapsible.astro index cc71c89..aa45d63 100644 --- a/src/components/NavCollapsible.astro +++ b/src/components/navigation/sidebars/nav/NavCollapsible.astro @@ -1,5 +1,5 @@ --- -import Accordion from "./Accordion.astro"; +import Accordion from "@components/Accordion.astro"; import navMarker from "@icons/nav-marker.svg?raw"; interface Props { diff --git a/src/components/navigation/sidebars/nav/Tree.astro b/src/components/navigation/sidebars/nav/Tree.astro index d3cb288..35c4135 100644 --- a/src/components/navigation/sidebars/nav/Tree.astro +++ b/src/components/navigation/sidebars/nav/Tree.astro @@ -1,5 +1,5 @@ --- -import NavCollapsible from "@components/NavCollapsible.astro"; +import NavCollapsible from "./NavCollapsible.astro"; import Self from "./Tree.astro"; import Link from "./Link.astro"; diff --git a/src/components/navigation/sidebars/Nav.astro b/src/components/navigation/sidebars/nav/index.astro similarity index 85% rename from src/components/navigation/sidebars/Nav.astro rename to src/components/navigation/sidebars/nav/index.astro index 9001700..8dd5d51 100644 --- a/src/components/navigation/sidebars/Nav.astro +++ b/src/components/navigation/sidebars/nav/index.astro @@ -1,6 +1,6 @@ --- -import SidebarWrapper from "./nav/SidebarWrapper.tsx"; -import RootNav from "./nav/RootNav.astro"; +import SidebarWrapper from "./SidebarWrapper.tsx"; +import RootNav from "./RootNav.astro"; const url = Astro.url.pathname.split("/"); const currentRoute = url[2]; diff --git a/src/layouts/DocsLayout.astro b/src/layouts/DocsLayout.astro index 4f33454..d35c255 100644 --- a/src/layouts/DocsLayout.astro +++ b/src/layouts/DocsLayout.astro @@ -6,7 +6,7 @@ import CreateCopyButtons from "@components/hooks/CreateCopyButtons.astro"; import PreTheme from "@config/PreTheme.astro"; import Header from "@components/Header.astro"; import Head from "@config/Head.astro"; -import Nav from "@components/navigation/sidebars/Nav.astro"; +import Nav from "@components/navigation/sidebars/nav/index.astro"; import type { ConfigHeading } from "@src/components/navigation/sidebars/types"; import Footer from "@src/components/Footer.astro"; diff --git a/src/styles/docs/nav/nav-tree.css b/src/styles/docs/nav/nav-tree.css index 67a35b4..4a2f341 100644 --- a/src/styles/docs/nav/nav-tree.css +++ b/src/styles/docs/nav/nav-tree.css @@ -28,6 +28,10 @@ &.nav-current { color: hsl(var(--nav-selected-text)); background-color: hsl(var(--nav-selected-bkg)); + + &:hover { + background-color: hsl(var(--nav-selected-hovered-bkg)); + } } } @@ -79,12 +83,16 @@ } & .accordion-container > div { - padding-left: 1.2em; + padding-left: 1.3em; & p:first-child { padding-top: 0; margin-top: 0; } + + & :last-child { + margin-bottom: 0rem; + } } } From 84703e3117eb2829e0ed6b4a995f1025359fb57b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 24 Oct 2024 21:43:22 -0700 Subject: [PATCH 2/2] fix module listing style --- src/pages/docs/types/[type]/index.astro | 2 +- src/pages/docs/types/index.astro | 36 +++++++++++--------- src/styles/docs/docs-types.css | 44 ------------------------- 3 files changed, 22 insertions(+), 60 deletions(-) diff --git a/src/pages/docs/types/[type]/index.astro b/src/pages/docs/types/[type]/index.astro index cdf191c..ff3480c 100644 --- a/src/pages/docs/types/[type]/index.astro +++ b/src/pages/docs/types/[type]/index.astro @@ -31,7 +31,7 @@ const details = route.data.details ---
diff --git a/src/pages/docs/types/index.astro b/src/pages/docs/types/index.astro index cda2394..e72f7d4 100644 --- a/src/pages/docs/types/index.astro +++ b/src/pages/docs/types/index.astro @@ -6,20 +6,26 @@ const routes = await getTypeData(); const modules = [...new Set(routes.map(route => route.type))]; --- - -

Type Definitions

-
- {modules.map(moduleEntry => { - const indexData = routes.filter(route => route.name === "index") - const indexSingled = indexData.filter(indexEntry => indexEntry.type === moduleEntry)[0] - const description = indexSingled.data.description - return ( -
- - {moduleEntry} - - {description} -
) - })} + +
+
+

Module Listing

+
+ All modules included with Quickshell +
+ {modules.map(moduleEntry => { + const indexData = routes.filter(route => route.name === "index") + const indexSingled = indexData.filter(indexEntry => indexEntry.type === moduleEntry)[0] + const description = indexSingled.data.description + return ( +
+ + {moduleEntry} + + {description} +
) + })} +
+
diff --git a/src/styles/docs/docs-types.css b/src/styles/docs/docs-types.css index 8be9bac..00c9984 100644 --- a/src/styles/docs/docs-types.css +++ b/src/styles/docs/docs-types.css @@ -19,29 +19,6 @@ &:not(:last-child) { border-bottom: 1px solid hsla(var(--blue) 10 15 / 0.6); } - - & .root-nav-link { - font-size: 1.137rem; - max-height: 2rem; - position: relative; - text-decoration: none; - text-align: center; - - &::before { - content: ""; - position: absolute; - bottom: 0; - left: 0; - width: 100%; - height: 1px; - background: linear-gradient( - 90deg, - transparent 25%, - hsla(var(--accent-500) / 0.88) 50%, - transparent 75% - ); - } - } } } @@ -353,27 +330,6 @@ html.dark .typevariants { display: grid; grid-template-columns: 0.60fr 1.40fr; - & .root-nav-link { - justify-self: start; - height: max-content; - - &::before { - width: 0; - background: linear-gradient( - to right, - hsla(var(--accent-400) / 0.5) var(--percent), - hsla(var(--accent-400) / 0) 100% - ); - animation: percentToZero 250ms ease-in-out forwards; - transition: width 0.25s ease-in-out; - } - - &:hover::before { - animation: percentToFifty 250ms ease-in-out forwards; - width: 100%; - } - } - & .root-nav-desc { padding-left: 1rem; border-left: 1px solid hsl(var(--blue) 10 15 / 0.6);