-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: tailwind css not being generated for components imported from a library #119
Comments
So looking at other (js) tailwind libraries, it seems like there isn't a standard solution here. Most of them just tell you to modify the tailwind config and add the library sources to it. The same can be done here, as the package allows a custom So for your example, you could add a module.exports = {
content: [
"{lib,web}/**/*.dart",
"../lib/**/*.dart"
]
} This would probably already work (havent tested yet). Next step could be to let the builder automatically add all the dependencies as sources (or somehow only detect the ones that use tailwind, otherwise the tailwind process will get super slow probably). That still leaves the inefficiently that css will be generated for components that you don't use, but as said in the beginning this seems to be also the case for js tailwind libraries and seemingly not solved there either. |
For the example this would probably work, but the idea is to import this package in other jaspr projects where setting the path would not be as straight forward. Also as you mentioned, that would generate css for all components even for those not in use by the project. Maybe a build_runner step could be a solution here? Imho we would like to create a dependency graph with all used classes and then pipe them into tailwind. To make it a bit easier, we could probably add an annotation in the library? |
I am currently having the same or similar issue where it is not being generated for me. |
Description
I want to create a component library with reusable jaspr components which should be styled using tailwind. I have create a new dart package with an example folder in which I want to showcase the components in the package.
The jaspr_tailwind builder only looks within its current directory (in this case the example) - as the imported components are outside of it, they are not evaluated and no css is generated for them.
Steps To Reproduce
dart create -t package <PACKAGE_NAME>
jaspr create
and import the package with a relative importExpected Behavior
The tailwind builder should take a look at all used (imported) classes (recursively) and compile css for them.
Additional Context
For context, this is my project structure:
The text was updated successfully, but these errors were encountered: