[JIT] prefix as a function breaks some classes
See original GitHub issueWhat version of Tailwind CSS are you using? 2.2.15
Reproduction URL https://play.tailwindcss.com/GlwsJggWJP?file=config
Describe your issue
When using prefix as a function to apply prefix only on some classes, it seems that classes with one character base name like m-2
, p-5
, w-full
and negative ones like -rotate-6
are not generated.
Add prefix (selector) { return ''; }
to tailwind config is breaking the output.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JIT does not work when prefix callback is specified · Issue #159
Just to clarify - adding a prefix callback does not break only the should-be-prefixed classes. When I specify the prefix callback, the entire...
Read more >Just-in-Time Mode - Tailwind CSS
The prefix option cannot detect complete class names when configured as a function. Because we don't generate class names in advance, we can...
Read more >Some Tailwind styles not working in production with Next.js
Well just so you know, changing it to class means that if there's an element with a class of dark , each child...
Read more >PHP 8.0: New Functions, Classes and JIT (4/4) | Nette Blog
PHP JIT (Just in Time Compiler) And what is a JIT? JIT can transparently compile PHP directly into machine code, which is executed...
Read more >Untitled
OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ... <span class="enscript-function-name">JITDisassembler::dump</span>( ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey! Thank you for your bug report! Much appreciated! 🙏
I’ve been looking into this and wrote a more in-depth explanation here: #5829 What I would recommend you to do is to use the
prefix
as a string instead of a function.Hey @RobinMalfait ! I dug into your explanation and really appreciate how far you push it and all details you provide to explain the issue and how you will sort this in the JIT world. It’s real insights into Tailwind development and a very instructive reading 🙌
In the end, I get a better sense of why
prefix
as a function is more of a hacky solution in this regard and the lack of consistency it brings to outputted classes.In my case I will handle it outside of tailwind to keep prefix free tailwind classes.
Thanks for your awesome work 🙏