Skip to content
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 Tailwind setup. Show extensions to install #8954

Merged
merged 7 commits into from
Jul 24, 2023

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Jul 23, 2023

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

This is what it looks like when running the setup command after my changes:
image


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

@Tobbe Tobbe requested a review from jtoar July 23, 2023 09:18
@Tobbe Tobbe added this to the v6.0.0 milestone Jul 23, 2023
@Tobbe Tobbe added the release:feature This PR introduces a new feature label Jul 23, 2023
@Tobbe Tobbe changed the title Update Tailwind setup Update Tailwind setup. Show extensions to install Jul 23, 2023
@Tobbe Tobbe added the fixture-ok Override the test project fixture check label Jul 23, 2023
Copy link
Contributor

@jtoar jtoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it locally and works, those extension messages are nice. Thanks @Tobbe!

@jtoar jtoar merged commit 4db450b into redwoodjs:main Jul 24, 2023
27 checks passed
jtoar pushed a commit that referenced this pull request Jul 26, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixture-ok Override the test project fixture check release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants