twin.examples
twin.examples copied to clipboard
Example of twin inside an nx-workspace with styled components
Based on #38 I did an example with styled-components. I added my scripts to handle multiple projects and add preset from a library
❤️ that we're coming at this from different side.
FYI: I just pushed an example with tailwind-config
as a separate, buildable nx lib.
It'd be great to get your thoughts and find an identical approach.
I can shoot first: it SUCKS that my tailwind-config
lib has to be a js module. I can't get it to work in ts and it makes me 😭
@mmmoli I don't know if you saw I also created a function to automatically get preset from another NX library and I use it to get preset from my UI library. You can see it here. I think that way it's really customizable
@anymaniax link's broken.
I see it here: https://github.com/ben-rogerson/twin.examples/blob/40b72ecb875b0610ddcb0a50c9a0d3d055df6b59/nx-workspace-styled-components/apps/web/tailwind.config.js
Thanks heaps for adding the styled-components version of this @anymaniax
I'll support whichever way you guys want to head with an identical preset approach. Personally, I'd shy away from adding custom functions in an example starter - but only if the same functionality can be provided in a simple way.
How about buildable libraries?
For now it seems like not working properly, because of ReferenceError: tw is not defined
Is there a recommended example repo to start from? Was hoping to use NX workspaces with twin and stitches if possible. Thanks for any pointers.
We haven't quite got a nx-workspace example through yet so you'll need to give one of these PR's a pilot test 🤞
What is the status of this PR? Would love to see an example on how to get started with NX!
Is there anything to do to help with this?
@nonameolsson I feel this example has too many files and features for a twin example. If it were simplified (remove cypress/jest/etc configs?) then it could join the others.