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>
This commit is contained in:
Zhi
2025-07-21 16:13:34 +02:00
committed by GitHub
co-authored by 李嘉图·M·路 Asher Gomez Marvin Hagemeister
parent 2d308f6b9e
commit bb23643779
30 changed files with 741 additions and 1144 deletions
+3 -3
View File
@@ -32,14 +32,14 @@ export default function CopyArea(props: { code: string }) {
}, [copied.value]);
return (
<div class="bg-slate-800 rounded text-green-100 flex items-center min-w-0 overflow-x-auto">
<div class="bg-slate-800 rounded-sm text-green-100 flex items-center min-w-0 overflow-x-auto">
<pre class="overflow-x-auto w-full flex-1 px-6 py-4">
{props.code}
</pre>
<div class="relative my-2 mr-4 sm:mr-6">
<div
class={`hidden transition ease-in-out absolute pointer-events-none bg-gray-900 text-white p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded opacity-0 ${
class={`hidden transition ease-in-out absolute pointer-events-none bg-gray-900 text-white p-2 -top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-full box-border rounded-sm opacity-0 ${
copied.value && "block opacity-100"
}`}
>
@@ -49,7 +49,7 @@ export default function CopyArea(props: { code: string }) {
type="button"
aria-label="Copy to Clipboard"
disabled={!IS_BROWSER}
class={`rounded p-1.5 border border-foreground-secondary/30 hover:bg-foreground-secondary/70 ${
class={`rounded-sm p-1.5 border border-foreground-secondary/30 hover:bg-foreground-secondary/70 ${
copied.value ? "text-fresh-green/80" : ""
} relative`}
onClick={handleClick}
+1 -1
View File
@@ -49,7 +49,7 @@ function RoundedButton(props: JSX.HTMLAttributes<HTMLButtonElement>) {
touchAction: "manipulation",
}}
{...props}
class="p-3 rounded-full border-2 border-current bg-white/20 hover:bg-white/50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-green-200 disabled:cursor-default"
class="p-3 rounded-full border-2 border-current bg-white/20 hover:bg-white/50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-green-200 disabled:cursor-default"
/>
);
}
+1 -1
View File
@@ -46,7 +46,7 @@ export function FormSubmitDemo() {
<button
type="submit"
value="Submit"
class="pt-2 pb-1 px-3 rounded border-current border-[1.5px] font-semibold"
class="pt-2 pb-1 px-3 rounded-sm border-current border-[1.5px] font-semibold"
>
Submit
</button>
+1 -1
View File
@@ -107,7 +107,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
type="button"
id="toc-outline-btn"
onClick={() => isOpen.value = !isOpen.value}
class="bg-background-primary py-2 px-4 rounded border border-foreground-secondary/30 flex items-center hover:border-fresh-green/80 transition-colors text-sm"
class="bg-background-primary py-2 px-4 rounded-sm border border-foreground-secondary/30 flex items-center hover:border-fresh-green/80 transition-colors text-sm"
>
On this page
<svg
+1 -1
View File
@@ -36,7 +36,7 @@ export default function VersionSelect(
id="version"
class={`rounded-md block border border-foreground-primary/20 appearance-none bg-background-primary form-select-bg font-semibold ${
selectedIsLatest ? "pr-22" : "pr-10"
} py-2 pl-3 w-full h-full leading-none sm:(text-sm leading-5) focus:(outline-none border-blue-300) hover:bg-background-secondary`}
} py-2 pl-3 w-full h-full leading-none sm:text-sm sm:leading-5 focus:outline-hidden focus:border-blue-300 hover:bg-background-secondary`}
value={selectedVersion}
onChange={(e) => {
if (e.currentTarget.value !== selectedVersion) {