Files
sweet/www/routes/thanks.tsx
T
bb23643779 feat: support tailwindcss v4 (#3054)
update /www and tailwind-plugin to support tailwind v4.

Thanks to the merge of #3034, the work of integrating and advancing
#2903 is promoted.

related #3034 
related #2903 

close #3056
close #2819

--patch-1 
based on review,

1. del compiler and make it more clean and simple,
2.  fix init tailwind part,
3. fix test tailwind part

--patch-2

1. fix the docs 
2. fix the docs of plugin and version

--patch-3
1. Addressed various maintenance tasks (chores)
2. Updated the Tailwind CSS plugin to align with this release. Generated
a fresh project using the updated init configuration and
3. deployed it via Deno Deploy EA. Deployment is functioning correctly.

--patch-4
Move postcss imports to Tailwind section in init script

--patch-5
Refactored Tailwind plugin type definitions by copying PluginOptions
properties from @tailwindcss/postcss and adding Fresh-specific exclude
option, while exporting types from package entrypoint for better
accessibility.

Test Project: https://fresh.fresh-press.deno.net/
Test Project Repository:
https://github.com/SisyphusZheng/fresh-tailwindv4
Test Plugin: https://jsr.io/@freshpress/fresh-plugin-tailwind@1.0.0

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-07-21 16:13:34 +02:00

67 lines
2.2 KiB
TypeScript

import { page } from "fresh";
import { PageSection } from "../components/PageSection.tsx";
import { DemoBox } from "../components/homepage/DemoBox.tsx";
import { define } from "../utils/state.ts";
export const handler = define.handlers({
GET(ctx) {
const search = new URLSearchParams(ctx.url.search);
const vote = search.get("vote");
return page({ vote });
},
});
export default define.page<typeof handler>(function ThanksForSubscribing(
props,
) {
const vote = props.data.vote ? props.data.vote.replaceAll(/-/g, " ") : null;
return (
<>
<PageSection>
<DemoBox>
<div class="space-y-2">
<h1 class="text-2xl md:text-3xl lg:text-4xl">
{vote
? `Thanks for voting for ${vote}!`
: `Form submitted successfully`}
</h1>
<p>
That was all handled server-side, with{" "}
<strong>no client-side JavaScript</strong>! Nifty, huh?
</p>
<p class="!mt-8">
…Anyway, you probably want to{" "}
<a href="/#forms-section" class="underline">go back now</a>.
</p>
<a
href="/#forms-section"
class="flex items-center gap-2 max-w-max !mt-4 mx-auto pt-3 pb-2 px-4 border-[1.5px] border-current rounded-sm"
>
<svg
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-arrow-right relative bottom-[0.05em] transition-transform ease-out duration-150"
width="1em"
height="1em"
viewBox="0 0 24 24"
stroke-width="3"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
style="transform:rotateY(180deg);"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M5 12l14 0" />
<path d="M13 18l6 -6" />
<path d="M13 6l6 6" />
</svg>
Back
</a>
</div>
</DemoBox>
</PageSection>
</>
);
});