-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update docs for Preprocessors #870
Conversation
Add `-D` flag for dev dependencies. Prevent error with `require()` in `postcss.config.js` cfr [this issue](vercel/next.js#10117)
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tailwindlabs/tailwindcss-com/GhRHqgbXZ5mo6QKXdiynCagLxqhd |
@@ -130,10 +130,10 @@ It's included directly in the `tailwindcss` package itself, so to use it all you | |||
// postcss.config.js | |||
module.exports = { | |||
plugins: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be object plugins: {}
Better late than never - thanks for that 👍 I've updated the arrays to be objects instead to conform to the new format. |
I recently setup a new RW project with Tailwind and noticed a few improvements I thought could be made First I wanted our setup to as closely as possible follow the latest instructions on https://tailwindcss.com/docs/installation/using-postcss Mainly that meant to use `@tailwind base;` etc instead of `@import ...` Unfortunately (?) I couldn't use their postcss config syntax, because they're using Next-specific syntax tailwindlabs/tailwindcss.com#870 TW PR that updated their docs vercel/next.js#10117 Next issue about the syntax with some good info in the comments, including motivation on why they use this non-standard syntax Secondly I got syntax warnings in my css files after setting up Tailwind. After some googling I fixed that by installing the VS Code Tailwind intellisense extension. Looking at our code I then realized we do add that extension to the list of recommended extensions in the user's project. But we never actually tell the user to install it. I should have looked at all the files the setup command modified, but even if I had, I probably wouldn't have realized that was one of the plugins that we recommend, because the plugin ID doesn't match the name of the plugin (the ID is `bradlc.vscode-tailwindcss`) This is the first warning I spotted (`Unknown at rule @tailwind css(unknownAtRules)`) ![image](https://github.com/redwoodjs/redwood/assets/30793/bfe13012-dc9d-437f-9f5a-6807c9a52337) This is what it looks like when running the setup command after my changes: ![image](https://github.com/redwoodjs/redwood/assets/30793/3eff2c9f-4375-4a7b-8466-379b8c9e8fc2) --- @jtoar * I selected the v6 milestone, but this totally doesn't have to go out in an RC. It can wait for v6.1 or whatever. It's non-breaking, but you decide when you want to release it. * For the upgrade guide we could suggest people switch to the declaration syntax instead of imports. But the imports still seem to work, so we could also just skip it.
I recently setup a new RW project with Tailwind and noticed a few improvements I thought could be made First I wanted our setup to as closely as possible follow the latest instructions on https://tailwindcss.com/docs/installation/using-postcss Mainly that meant to use `@tailwind base;` etc instead of `@import ...` Unfortunately (?) I couldn't use their postcss config syntax, because they're using Next-specific syntax tailwindlabs/tailwindcss.com#870 TW PR that updated their docs vercel/next.js#10117 Next issue about the syntax with some good info in the comments, including motivation on why they use this non-standard syntax Secondly I got syntax warnings in my css files after setting up Tailwind. After some googling I fixed that by installing the VS Code Tailwind intellisense extension. Looking at our code I then realized we do add that extension to the list of recommended extensions in the user's project. But we never actually tell the user to install it. I should have looked at all the files the setup command modified, but even if I had, I probably wouldn't have realized that was one of the plugins that we recommend, because the plugin ID doesn't match the name of the plugin (the ID is `bradlc.vscode-tailwindcss`) This is the first warning I spotted (`Unknown at rule @tailwind css(unknownAtRules)`) ![image](https://github.com/redwoodjs/redwood/assets/30793/bfe13012-dc9d-437f-9f5a-6807c9a52337) This is what it looks like when running the setup command after my changes: ![image](https://github.com/redwoodjs/redwood/assets/30793/3eff2c9f-4375-4a7b-8466-379b8c9e8fc2) --- @jtoar * I selected the v6 milestone, but this totally doesn't have to go out in an RC. It can wait for v6.1 or whatever. It's non-breaking, but you decide when you want to release it. * For the upgrade guide we could suggest people switch to the declaration syntax instead of imports. But the imports still seem to work, so we could also just skip it.
Add
-D
flag for dev dependencies.Prevent error with
require()
inpostcss.config.js
cfr this issue