You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create a new package dart create -t package <PACKAGE_NAME>
Create a component inside the lib folder
Create an example in ./example using jaspr create and import the package with a relative import
Run the example
Expected 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:
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.
So I had to remove all the files mentioned in the docs and here and just resorted to using the cdn link from tailwind.
It would be awesome to know if there is a fix for this or if the docs can be updated to let us know the correct method to set up or any gotchas to look out for.
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:
![image](https://private-user-images.githubusercontent.com/13539680/269060477-6e575579-c258-46c1-8f99-c3b48536bbcd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4MzEyODcsIm5iZiI6MTcyMTgzMDk4NywicGF0aCI6Ii8xMzUzOTY4MC8yNjkwNjA0NzctNmU1NzU1NzktYzI1OC00NmMxLThmOTktYzNiNDg1MzZiYmNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI0VDE0MjMwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5OWUyNzhiNTNjZjYzZjk4OWM1MzNjZmI1NjVmNzcyOWRmMzU5N2U0ZjA3Y2M1Yjk5MTJjMjQxNWZhZjQyMTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.r7btHbMAEPVo0_E-mvXlYwKaRp65b1XXRS14hRLWTsA)
The text was updated successfully, but these errors were encountered: