Can't use @apply within the project's native CSS code.
See original GitHub issueAt present, the apply
function is only useable within javascript.
It would be great to be able to use it as a css directive @apply
so that we can get access and apply all Tailwind classes within any CSS file, <style>
tag of an HTML file or Svelte component, etc…
Ideas for enabling this might be to do it with a vite or postcss plugin.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Solving the React Error: Not Picking Up CSS Style | Pluralsight
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >Using CSS Modules in React Native - LogRocket Blog
CSS Modules enable you to use locally scoped styles in your React Native app, which makes your code significantly cleaner and more readable....
Read more >Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >Handling common HTML and CSS problems - MDN Web Docs
With the scene set, we'll now look specifically at the common ... This includes linting code, handling CSS prefixes, using browser dev tools ......
Read more >Using with Preprocessors - Tailwind CSS
The place you are most likely to run into this situation is in your main CSS file that includes your @tailwind declarations. Won't...
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 FreeTop 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
Top GitHub Comments
What I hope to achieve is integration with existing tooling (postcss, vite, webpack, …) that would allow full static extraction without any config. Basically what you two (@danielweck and @rschristian) are already doing.
In my opinion, twind should be able to process existing CSS with support
apply
,theme
, andscreen
.For svelte:
@sastan will no doubt introduce a clean “native” Twind API to handle the
<style>
use case, but in the meantime this can easily be achieved in userland with Twind v1 (Work In Progress “next” version https://github.com/tw-in-js/twind/tree/next )