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
+1 -1
View File
@@ -6,7 +6,7 @@ export function FancyLink(
return (
<a
href={props.href}
class={`group p-4 px-5 pb-3.5 bg-gradient-to-br from-fresh/40 to-fresh font-semibold rounded leading-none flex items-center justify-center hover:bg-fresh transition-colors duration-200 ease-in-out max-w-max text-balance ${
class={`group p-4 px-5 pb-3.5 bg-gradient-to-br from-fresh/40 to-fresh font-semibold rounded-sm leading-none flex items-center justify-center hover:bg-fresh transition-colors duration-200 ease-in-out max-w-max text-balance ${
props.class ?? ""
}`}
>
+1 -1
View File
@@ -11,7 +11,7 @@ export default function Header(props: { title: string; active: string }) {
"mx-auto flex gap-3 items-center",
isHome ? "justify-end h-20 max-w-screen-xl" : "justify-between",
isDocs
? "h-20 max-w-screen-2xl w-full sticky top-0 bg-background-primary z-50 backdrop-blur-sm"
? "h-20 max-w-screen-2xl w-full sticky top-0 bg-background-primary z-50 backdrop-blur-xs"
: "",
isShowcase ? "max-w-screen-xl w-full" : "",
].join(" ")}
+1 -1
View File
@@ -27,7 +27,7 @@ export function SideBySide(props: SideBySideProps) {
return (
<div
class={`grid grid-cols-1 items-center gap-12 md:gap-16 xl:gap-32 ${
props.reverseOnDesktop ? "md:first:[&>*]:order-1" : ""
props.reverseOnDesktop ? "[&>*]:md:first:order-1" : ""
} ${mdSplitClass} ${lgSplitClass} ${props.class ?? ""}`}
>
{props.children}
+1 -1
View File
@@ -9,7 +9,7 @@ export function Hero(props: { origin: string }) {
<div class="bg-green-300 mt-0 pt-32 md:pt-48 !mb-0 bg-gradient-to-br from-blue-100 via-green-200 to-yellow-100">
<div class="md:grid grid-cols-5 gap-8 md:gap-16 items-center w-full max-w-screen-xl mx-auto px-4 md:px-8 lg:px-16 2xl:px-0">
<div class="flex-1 text-center md:text-left md:col-span-3 pb-8 md:pb-32">
<h2 class="text-[calc(1rem+4vw)] leading-tight sm:text-5xl lg:text-6xl sm:tracking-tight sm:leading-none! font-extrabold">
<h2 class="text-[calc(1rem+4vw)] leading-tight sm:text-5xl lg:text-6xl sm:tracking-tight sm:leading-none font-extrabold">
The simple, approachable, productive web framework
</h2>
<div class="mt-12 flex flex-wrap justify-center items-stretch md:justify-start gap-4">
+1 -1
View File
@@ -4,7 +4,7 @@ export function SectionHeading(
{ children }: { children: ComponentChildren },
) {
return (
<h2 class="text-3xl lg:text-4xl xl:text-5xl text-gray-600 font-bold text-balance">
<h2 class="text-3xl lg:text-4xl xl:text-5xl text-gray-600 font-[750] text-balance">
{children}
</h2>
);
+1 -1
View File
@@ -5,7 +5,7 @@ export function Simple() {
<PageSection class="!mb-12 !mt-20">
<div class="text-center max-w-max mx-auto flex flex-col gap-4">
<p class="italic text-gray-500 text-lg">Introducing Fresh:</p>
<h2 class="text-4xl sm:text-5xl md:text-6xl lg:text-7xl sm:tracking-tight sm:leading-[1.1]! font-extrabold text-balance text-gray-600">
<h2 class="text-4xl sm:text-5xl md:text-6xl lg:text-7xl sm:tracking-tight font-extrabold text-balance text-gray-600">
The framework so simple, you already know it.
</h2>
<p class="text-xl text-balance max-w-prose mx-auto">
+1 -1
View File
@@ -6,7 +6,7 @@ export function SocialProof() {
return (
<PageSection>
<div class="text-center max-w-max mx-auto flex flex-col gap-4">
<h2 class="text-gray-600 text-4xl sm:text-5xl md:text-6xl lg:text-7xl sm:tracking-tight sm:leading-[1.1]! font-extrabold text-balance">
<h2 class="text-gray-600 text-4xl sm:text-5xl md:text-6xl lg:text-7xl sm:tracking-tight sm:leading-[1.1] font-extrabold text-balance">
Built for the edge
</h2>
<p class="text-xl text-balance max-w-prose mx-auto">