From dd65692bf6d38b99d9723259ddebdbcaeddf0ce5 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Wed, 1 May 2024 17:33:06 +0800
Subject: [PATCH 1/6] Bump to Twind v1
https://fresh.deno.dev/docs/examples/using-twind-v1
---
fresh.config.ts | 2 +-
twind.config.ts | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fresh.config.ts b/fresh.config.ts
index fd48d1b..e1ebe91 100644
--- a/fresh.config.ts
+++ b/fresh.config.ts
@@ -1,5 +1,5 @@
import { defineConfig } from "$fresh/server.ts";
-import twindPlugin from "$fresh/plugins/twind.ts";
+import twindPlugin from "$fresh/plugins/twindv1.ts";
import twindConfig from "./twind.config.ts";
export default defineConfig({
plugins: [twindPlugin(twindConfig)],
diff --git a/twind.config.ts b/twind.config.ts
index 2a7ac27..b58b8f8 100644
--- a/twind.config.ts
+++ b/twind.config.ts
@@ -1,5 +1,10 @@
-import { Options } from "$fresh/plugins/twind.ts";
+import { defineConfig, Preset } from "https://esm.sh/@twind/core@1.1.3";
+import presetTailwind from "https://esm.sh/@twind/preset-tailwind@1.1.4";
+import presetAutoprefix from "https://esm.sh/@twind/preset-autoprefix@1.0.7";
export default {
+ ...defineConfig({
+ presets: [presetTailwind() as Preset, presetAutoprefix()],
+ }),
selfURL: import.meta.url,
-} as Options;
+};
From 1da2c46c3e4141b25324b62e18a0c1bf0a1b7713 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Wed, 1 May 2024 17:46:24 +0800
Subject: [PATCH 2/6] Update imports to use import map
---
twind.config.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/twind.config.ts b/twind.config.ts
index b58b8f8..8c5b4d2 100644
--- a/twind.config.ts
+++ b/twind.config.ts
@@ -1,6 +1,6 @@
-import { defineConfig, Preset } from "https://esm.sh/@twind/core@1.1.3";
-import presetTailwind from "https://esm.sh/@twind/preset-tailwind@1.1.4";
-import presetAutoprefix from "https://esm.sh/@twind/preset-autoprefix@1.0.7";
+import { defineConfig, Preset } from "@twind/core";
+import presetTailwind from "@twind/preset-tailwind";
+import presetAutoprefix from "@twind/preset-autoprefix";
export default {
...defineConfig({
From 50180f80e97b2444df35c6740d3f3565d16acf04 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Wed, 1 May 2024 18:09:46 +0800
Subject: [PATCH 3/6] Remove old twind imports in deno.json
---
deno.json | 2 --
1 file changed, 2 deletions(-)
diff --git a/deno.json b/deno.json
index b951d2c..f6a416e 100644
--- a/deno.json
+++ b/deno.json
@@ -16,8 +16,6 @@
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1",
- "twind": "https://esm.sh/twind@0.16.19",
- "twind/": "https://esm.sh/twind@0.16.19/",
"$gfm": "https://deno.land/x/gfm@0.1.28/mod.ts",
"$prism": "https://esm.sh/prismjs@1.29.0",
"$prism/": "https://esm.sh/prismjs@1.29.0/",
From eb0dc290979973716dde281264944147e56034c1 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Thu, 2 May 2024 18:52:12 +0800
Subject: [PATCH 4/6] Dark theme support
---
components/Footer.tsx | 2 +-
components/Header.tsx | 4 ++--
components/Page.tsx | 2 +-
islands/CopyButton.tsx | 15 ++++++++++-----
routes/[id]/index.tsx | 39 +++++++++++++++++++++++++--------------
routes/index.tsx | 10 +++++-----
6 files changed, 44 insertions(+), 28 deletions(-)
diff --git a/components/Footer.tsx b/components/Footer.tsx
index 5d2fe47..e2c90bb 100644
--- a/components/Footer.tsx
+++ b/components/Footer.tsx
@@ -15,7 +15,7 @@ export function Footer() {
Deno Deno
-
+
Deno
-
+
by example
diff --git a/components/Page.tsx b/components/Page.tsx
index 6007931..e3cf750 100644
--- a/components/Page.tsx
+++ b/components/Page.tsx
@@ -10,7 +10,7 @@ export function Page(props: {
}) {
return (
+
Run{" "} this example {" "} locally using the Deno CLI:
-
+
{example.run.startsWith("deno")
? example.run.replace("", url)
: "deno run " + example.run.replace("", url)}
@@ -170,7 +172,7 @@ export default function ExamplePage(props: PageProps) {
)}
{example.playground && (
-
+
Try this example in a Deno Deploy playground:
@@ -192,7 +194,7 @@ export default function ExamplePage(props: PageProps) {
{example.additionalResources.map(([link, title]) => (
-
@@ -211,7 +213,7 @@ export default function ExamplePage(props: PageProps) {
? (
{prev.title}
@@ -221,7 +223,7 @@ export default function ExamplePage(props: PageProps) {
{next && (
{next.title}
@@ -247,11 +249,11 @@ function SnippetComponent(props: {
return (
-
+
{props.snippet.text}
{props.filename && (
@@ -269,8 +271,17 @@ function SnippetComponent(props: {
-
-
+
+
diff --git a/routes/index.tsx b/routes/index.tsx
index 30ff0a7..06cae81 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -39,26 +39,26 @@ export default function Home(props: PageProps) {
-
+
Deno
-
+
by example
-
+
Deno is a simple, modern and secure runtime for JavaScript and
TypeScript that uses V8 and is built in Rust.
-
+
Deno by example{" "}
is a collection of annotated examples for how to use Deno, and the
various features it provides. It acts as a reference for how to do
various things in Deno, but can also be used as a guide to learn about
many of the features Deno provides.
-
+
{props.data.map(
(group) => ,
)}
From f2d2a142314f5cb8b40e700a1ca29f20442e6b51 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Fri, 3 May 2024 06:46:39 +0800
Subject: [PATCH 5/6] Fix stylesheet in copy button SVG
---
islands/CopyButton.tsx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/islands/CopyButton.tsx b/islands/CopyButton.tsx
index a39c8b4..5739fef 100644
--- a/islands/CopyButton.tsx
+++ b/islands/CopyButton.tsx
@@ -10,13 +10,16 @@ function Copy() {
>
-
+
);
}
From eb780d9134b6534bbc221438eb8d92063da39176 Mon Sep 17 00:00:00 2001
From: kLiHz <66966137+kLiHz@users.noreply.github.com>
Date: Sat, 4 May 2024 02:24:28 +0800
Subject: [PATCH 6/6] Set `backgroud-color` to `body` instead of `div`
---
components/Page.tsx | 2 +-
routes/_app.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/Page.tsx b/components/Page.tsx
index e3cf750..6007931 100644
--- a/components/Page.tsx
+++ b/components/Page.tsx
@@ -10,7 +10,7 @@ export function Page(props: {
}) {
return (
diff --git a/routes/_app.tsx b/routes/_app.tsx
index 0f65d05..e2591f1 100644
--- a/routes/_app.tsx
+++ b/routes/_app.tsx
@@ -7,7 +7,7 @@ export default function App({ Component }: PageProps) {
-
+