#Tailwind 4 and Payload Admin

4 messages · Page 1 of 1 (latest)

wet sand
#

I followed this video, and loading tailwind without the base only works in dev. if you make a production build it doesnt pick up the tailwind styling in the admin panel.

@layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities);

do any of you guys have a way of making it work in a full production build?

https://youtu.be/n7AwZZVWYCA?si=LgGGErYOpROJBEO3

Welcome to this in-depth tutorial where we’ll be customizing the Payload Admin Panel! 🎨🛠️

✉️ Subscribe to our free Payload Newsletter:
https://allaboutpayload.com

🔗 Useful Links:
Snippet Library: https://snippets.10xmedia.de
Payload Theme Generator: https://10xmedia.de/theme

⏰ Timestamps:
00:00 Introduction & Overview 🎬...

▶ Play video
upbeat fiberBOT
red imp
#

I have the same issue bru, did you manage to solve this?

dry anvil
#

this is what i use `@layer theme, base, components, utilities;

/* Import the Tailwind theme styles */
@import 'tailwindcss/theme.css' layer(theme);

/* Skip the preflight reset to avoid conflicts with Payload's admin styles /
/
@import 'tailwindcss/preflight.css' layer(base); */

/* Import Tailwind utilities */
@import 'tailwindcss/utilities.css' layer(utilities);

/* Support Payload’s dark mode toggle by adding a custom variant */
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
`