formaat-design / reshaped

Community repository for storing examples, reporting issues and tracking roadmap
https://reshaped.so
110 stars 3 forks source link

[Bug] Tailwind setup failed #131

Closed mmailaender closed 1 year ago

mmailaender commented 1 year ago

I tried to set up Tailwind with Reshaped (Used this documentation: https://tailwindcss.com/docs/guides/nextjs)

It's not working atm, so is there some potential conflict with Reshaped? (It's not throwing any errors)

I also tried it with this posstcss.config.js because I saw that Reshaped is exporting its own PostCSS config:

const postcss = require("reshaped/postcss");
module.exports = {
    plugins: {
        ...postcss.config.plugins,
        tailwindcss: {},
    }
}
blvdmitry commented 1 year ago

This issue should be resolved now with https://github.com/formaat-design/community/tree/master/examples/integration-tailwind

mmailaender commented 1 year ago

@blvdmitry The postcss config is not yet covered by your docs:

Tailwind: https://tailwindcss.com/docs/using-with-preprocessors#build-time-imports Reshaped: https://reshaped.so/content/docs/getting-started/react/installation#setup-css

It would be good if you provided a code snippet that brings both together.

blvdmitry commented 1 year ago

Adding this little bit from the repository example:

image
mmailaender commented 1 year ago

@blvdmitry What do you think about adding Tailwind natively to the reshaped installation? It's a dev dependency, so it has no negative impact on the bundle size. On the other side, it would increase the convenience and easiness to use.

blvdmitry commented 1 year ago

I think it would still look for the tailwind and postcss config at your project root, but at the same time it will lock you down to a specific version of tailwind if we install it on our side

mmailaender commented 1 year ago

You could generate the configs with the CLI. 🤔 Do you see a problem with simply having the latest Tailwind version shipped with Reshaped every time?

blvdmitry commented 1 year ago

It might be an issue if there are breaking changes coming from a major Tailwind release at some point but the product using reshaped is not yet ready to migrate. We'll lock the people out from upgrading for no reason

mmailaender commented 1 year ago

You can do it like Nextjs with their newest CLI in update 13.4 image

Btw. 13.4 is simply AMAZING

mmailaender commented 1 year ago

They add it as dependency and not peer-dependency image

blvdmitry commented 1 year ago

Ah, so I think you mean it would benefit to have create-reshaped-app then with multiple options, since Next CLI installs Tailwind into your project and you then have full control over the version

mmailaender commented 1 year ago

Yes, exactly 🙂