Skip to content

Example of twin inside an nx-workspace with styled components#49

Open
anymaniax wants to merge 1 commit into
ben-rogerson:masterfrom
anymaniax:master
Open

Example of twin inside an nx-workspace with styled components#49
anymaniax wants to merge 1 commit into
ben-rogerson:masterfrom
anymaniax:master

Conversation

@anymaniax

Copy link
Copy Markdown

Based on #38 I did an example with styled-components. I added my scripts to handle multiple projects and add preset from a library

@anymaniax anymaniax changed the title feat(nx-twin-styled-components): setup Example of twin inside an nx-workspace with styled components Mar 9, 2021
@mmlngl

mmlngl commented Mar 10, 2021

Copy link
Copy Markdown

❤️ 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 😭

@anymaniax

Copy link
Copy Markdown
Author

@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

@mmlngl

mmlngl commented Mar 11, 2021

Copy link
Copy Markdown

@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

@ben-rogerson

ben-rogerson commented Mar 11, 2021

Copy link
Copy Markdown
Owner

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.

@Crisis2010

Crisis2010 commented Apr 17, 2021

Copy link
Copy Markdown

How about buildable libraries?

For now it seems like not working properly, because of ReferenceError: tw is not defined
Снимок экрана 2021-04-17 в 8 59 02 PM

@alanontheweb

Copy link
Copy Markdown

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.

@ben-rogerson

ben-rogerson commented Jun 24, 2021

Copy link
Copy Markdown
Owner

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 🤞

@nonameolsson

nonameolsson commented Mar 9, 2022

Copy link
Copy Markdown

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?

@ben-rogerson

Copy link
Copy Markdown
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants