Replies: 2 comments 1 reply
-
do you use this code in real site? |
Beta Was this translation helpful? Give feedback.
-
Thank you for providing such a thorough guide.
I have built a plugin named WindPress that uses the upcoming Tailwind CSS v4.0. We use a different approach for running Tailwind CSS. Instead of running it on the server, which requires additional server/environment setup, we run it entirely on the browser. If you are interested in diving in and contributing, you can access the source code at https://github.com/wind-press/windpress |
Beta Was this translation helpful? Give feedback.
-
I hope this is the right place to share this? (maybe move to show and tell?)
But just wanted to share the following code snippets that might be helpfull for others working with wordpress and tailwind.
The idea is a switch for development mode true/false that switches between tailwind cdn for development and tailwind cli for production.
For the switch I use
ACF Options Page Admin
andAdvanced Custom Fields PRO 5
. But you could change this into a hardcoded true/false value if you like.In development
When in production mode the first page hit will
theme/custom-theme/tailwind/tailwindcss
tailwind-content-classes.txt
with all the classes that live in the contentPros:
Cons:
shell_exec
Will copy some of the file contents below. Keep in mind this all quick/dirty/ugly code but I hope someone smarter could use this idea and make a beautifull plugin for other wordpress users :D
theme/custom-theme/tailwind.config.js
theme/custom-theme/tailwind.css
theme/custom-theme/your-theme-header.php
theme/custom-theme/functions.php
Beta Was this translation helpful? Give feedback.
All reactions