diff --git a/env.js b/env.js index e6969ca..7146859 100644 --- a/env.js +++ b/env.js @@ -1,4 +1,4 @@ -export const ENABLE_ALL = true; +export const ENABLE_ALL = false; export const ENABLE_SW = ENABLE_ALL ?? true; export const USE_SHAREDWORKER = ENABLE_ALL ?? true; export const PRODUCTION_MODE = ENABLE_ALL ?? true; diff --git a/my-astro-site/postcss.config.js b/my-astro-site/postcss.config.js index d2c5a9b..189c7d3 100644 --- a/my-astro-site/postcss.config.js +++ b/my-astro-site/postcss.config.js @@ -5,11 +5,11 @@ const { outDir } = require("./shared.config.js"); let cssFolder = `${outDir}/assets`; module.exports = { plugins: [ - postcssFontGrabber({ - // postcss-font-grabber needs to know the CSS output - // directory in order to calculate the new font URL. - cssDest: `${cssFolder}/`, - fontDest: `${cssFolder}/fonts/`, - }), + // postcssFontGrabber({ + // // postcss-font-grabber needs to know the CSS output + // // directory in order to calculate the new font URL. + // cssDest: `${cssFolder}/`, + // fontDest: `${cssFolder}/fonts/`, + // }), ], }; \ No newline at end of file diff --git a/my-astro-site/src/components/Button.tsx b/my-astro-site/src/components/Button.tsx new file mode 100644 index 0000000..7bd5b31 --- /dev/null +++ b/my-astro-site/src/components/Button.tsx @@ -0,0 +1,17 @@ +import { ComponentProps, ParentProps } from "solid-js"; + +export function Button(props: ParentProps>) { + let { + type = "button", + children, + ...attrs + } = props; + + return ( + + ); +} + +export default Button; \ No newline at end of file diff --git a/my-astro-site/src/components/Container.astro b/my-astro-site/src/components/Container.astro index 162dbe5..8b998da 100644 --- a/my-astro-site/src/components/Container.astro +++ b/my-astro-site/src/components/Container.astro @@ -7,7 +7,7 @@ export interface Props { let { max = "md", - class: className = "", + class: className = "col", ...attrs } = Astro?.props?.content ?? Astro?.props; --- @@ -19,9 +19,12 @@ let { \ No newline at end of file diff --git a/my-astro-site/src/components/Details.tsx b/my-astro-site/src/components/Details.tsx new file mode 100644 index 0000000..d15b339 --- /dev/null +++ b/my-astro-site/src/components/Details.tsx @@ -0,0 +1,45 @@ +import { type ComponentProps, type JSX, onCleanup, onMount } from "solid-js"; +import IconChevronRightArrow from "~icons/fluent/chevron-right-24-regular"; +import { createDetailsEffect } from "../scripts/details"; + +export function Details(props: ComponentProps<'details'> & { + children?: JSX.Element; + summary?: string; + summaryClass?: string; + contentClass?: string; +}) { + let { + children, + summary, + summaryClass = "px-4 py-2 cursor-pointer select-none", + contentClass = "pl-4 pr-2 py-4", + ...attrs + } = props; + + let ref: HTMLDetailsElement; + let summaryRef: HTMLElement; + let contentRef: HTMLDivElement; + + let { + onClick: _onClick, + onCleanup: _onCleanup, + onMount: _onMount + } = createDetailsEffect(); + + onMount(() => _onMount(ref, summaryRef, contentRef)); + onCleanup(() => _onCleanup()); + + return ( +
+ +

{summary}

+ +
+
+ {children} +
+
+ ); +} + +export default Details; \ No newline at end of file diff --git a/my-astro-site/src/components/DocsSection/Docs.md b/my-astro-site/src/components/DocsSection/Docs.md index f73248f..5492926 100644 --- a/my-astro-site/src/components/DocsSection/Docs.md +++ b/my-astro-site/src/components/DocsSection/Docs.md @@ -4,6 +4,7 @@ setup: | import ProductHunt from "../ProductHunt.astro"; import VisitCounter from "./VisitCounter/VisitCounter.astro"; --- + > 📑 Official [Docs](https://blog.okikio.dev/documenting-an-online-bundler-bundlejs) for `bundlejs` are now available. > ✨ Update ✨ [bundlejs.com](https://bundlejs.com) is the new official domain for `bundlejs`. @@ -16,8 +17,10 @@ setup: | - +
+ -
- -
\ No newline at end of file +
+ +
+
diff --git a/my-astro-site/src/components/DocsSection/Snippet.astro b/my-astro-site/src/components/DocsSection/Snippet.astro index 781259d..c9ca2b9 100644 --- a/my-astro-site/src/components/DocsSection/Snippet.astro +++ b/my-astro-site/src/components/DocsSection/Snippet.astro @@ -1,44 +1,16 @@ --- +import Icon from "astro-icon"; +import SnippetDetails from "../SnippetDetails"; + let opts = Astro?.props?.content ?? Astro?.props; --- -
- -

{opts.title}

-
-
+
+ -
-
- - - \ No newline at end of file + + \ No newline at end of file diff --git a/my-astro-site/src/components/DocsSection/Snippets.astro b/my-astro-site/src/components/DocsSection/Snippets.astro index fee503a..6e1c76c 100644 --- a/my-astro-site/src/components/DocsSection/Snippets.astro +++ b/my-astro-site/src/components/DocsSection/Snippets.astro @@ -16,14 +16,23 @@ let sortFn = (a, b) => { return 0; }; --- -{ - snippets - .sort(sortFn) - .map(async ({ Content, frontmatter }) => { - return ( - - - - ); - }) -} \ No newline at end of file + +
+ { + snippets + .sort(sortFn) + .map(async ({ Content, frontmatter }) => { + return ( + + + + ); + }) + } +
+ + \ No newline at end of file diff --git a/my-astro-site/src/components/DocsSection/VisitCounter/VisitCounter.astro b/my-astro-site/src/components/DocsSection/VisitCounter/VisitCounter.astro index 61fd918..9aaf06a 100644 --- a/my-astro-site/src/components/DocsSection/VisitCounter/VisitCounter.astro +++ b/my-astro-site/src/components/DocsSection/VisitCounter/VisitCounter.astro @@ -14,6 +14,14 @@ import HitCounter from "./HitCounter"; } [custom-anchor] { - @apply bg-gray-100 bg-elevated px-4 py-2 rounded-md; + @apply bg-gray-100 px-4 py-2 rounded-md; + @apply text-secondary; + @apply no-underline; + } + + @at-root :global(.dark) { + [custom-anchor] { + @apply bg-elevated text-primary; + } } \ No newline at end of file diff --git a/my-astro-site/src/components/Footer.astro b/my-astro-site/src/components/Footer.astro index 242e10f..509a457 100644 --- a/my-astro-site/src/components/Footer.astro +++ b/my-astro-site/src/components/Footer.astro @@ -4,42 +4,63 @@ import Anchor from "./Anchor.astro"; import Container from "./Container.astro"; import { ThemeSwitch } from "./ThemeSwitch"; +import Button from "./Button"; --- -