Replies: 6 comments 4 replies
-
I'm going to move this issue to the ideas discussions page since it is currently not a bug. We have to think about if we want to expose this behaviour at all or not, because making parts async in the config could lead to a lot of performance issues if we or our users aren't careful. E.g.: imagine somebody making an API call to fetch a value when you are using the |
Beta Was this translation helpful? Give feedback.
-
Interesting point. Currently, postcss processing is an async function. Loading a css file, processing it and using the I landed up having to run spawn a worker in sync to process the file, serialize and deserialize the json object. IMHO, this should be the responsibility of the developer. Perhaps the framework could add some tracing for execution time by plugin, and optionally But now I feel I am asking for a mile, I only want the inch. :) |
Beta Was this translation helpful? Give feedback.
-
@adamwathan Thanks for responding. I did not mean to imply it was a simple change. I haven'r actually looked at the tailwind codebase - so feel very under qualified to propose code changes. Not withstanding my complaint in the discussion above, tailwind has made working with styling a pleasure. |
Beta Was this translation helpful? Give feedback.
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
Bump - this is greatly needed. |
Beta Was this translation helpful? Give feedback.
-
I have created a package for this purpose: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
"tailwindcss": "3.3.3"
What build tool (or framework if it abstracts the build tool) are you using?
"next": "13.4.10",
What version of Node.js are you using?
❯ node -v
v18.13.0
What browser are you using?
chrome, NA
What operating system are you using?
macOS
Reproduction URL
https://github.com/sramam/zz-tailwind-config-async
Describe your issue
I need to load files and process in a tailwind plugin. The processing is an async operation
and, making the plugin an async function.
tailwind.config.ts
doesn't seem to like async functions.The repo above provides the smallest reproduction I could make to illustrate the issue.
To reproduce:
visit https://localhost:3000
edit
tailwind.config.ts
Line 41:Notice the orange text background.
Desired Behavior
The async function not just for themes, but plugins and everywhere else, should work like the sync versions.
Beta Was this translation helpful? Give feedback.
All reactions