#Tailwind v4 on TanStack Start

1 messages · Page 1 of 1 (latest)

agile jasper
#

Hello, has anyone managed to set up Tailwind v4 on TanStack Start? Because for me, it works in the dev environment but not in the build environment

gleaming girder
#

@agile jasper you need to specifiy the root for tailwind to scan your classes, in your styles.css

@import "tailwindcss" source("../")

vivid summit
hollow jay
#

awesome thank you guys @gleaming girder @vivid summit ♥️

agile jasper
#

thanks, I found another solution :
// app/routes/__root.tsx

import appCss from "../styles/styles.css?url"
export const Route = createRootRoute({
head: () => ({
meta: [
{
charSet: 'utf-8',
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
title: 'TanStack Start Starter',
},
],
links: [
{ rel: "stylesheet", href: appCss },
],
}),

component: RootComponent,
notFoundComponent: () => <div>Not Found</div>,
})

civic trout
#

how is that "another" solution? you still need the source set in the css file

#

otherwise you will run into hydration errors