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

feat: tailwind v4 #10773

Merged
merged 13 commits into from
Jan 29, 2025
Merged

feat: tailwind v4 #10773

merged 13 commits into from
Jan 29, 2025

Conversation

florian-lefebvre
Copy link
Member

Description (required)

Related PR: withastro/astro#13049

Related issues & labels (optional)

  • Closes #
  • Suggested label:

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jan 23, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/fonts.mdx Source changed, localizations will be marked as outdated.
en/guides/integrations-guide/lit.mdx Source changed, localizations will be marked as outdated.
en/guides/integrations-guide/tailwind.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-create-react-app.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-gatsby.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-nextjs.mdx Source changed, localizations will be marked as outdated.
en/guides/styling.mdx Source changed, localizations will be marked as outdated.
en/recipes/tailwind-rendered-markdown.mdx Source changed, localizations will be marked as outdated.
en/reference/integrations-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link

netlify bot commented Jan 23, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 31b2a72
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/679a7b9ca2d35a0008495225
😎 Deploy Preview https://deploy-preview-10773--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@florian-lefebvre
Copy link
Member Author

Do we want to keep line 99?

@sarah11918 sarah11918 added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) labels Jan 24, 2025
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

I think this looks great! Others still welcome to suggest improvements, but this is fine by me!

@sarah11918 sarah11918 added the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Jan 24, 2025
Comment on lines 4 to 5
sidebar:
label: Tailwind
Copy link
Member

Choose a reason for hiding this comment

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

LGTM, less work for translators. 😄

Two suggestions:

  1. I think we can also remove the sidebar label since it's no longer in the sidebar.
Suggested change
sidebar:
label: Tailwind
  1. Maybe we should also update the link Astro’s Tailwind integration in Prerequisites in /en/recipes/tailwind-rendered-markdown/ to use the one from Tailwind instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. I matched what was done for Lit, so maybe we can clean it up as well
  2. You're right, we probably need to scan for any link to the tailwind integration

I'm also wondering if on the integration page, we should link to the styles page so everyone goes through the same flow

Copy link
Member

Choose a reason for hiding this comment

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

  1. Oh just nitpicking, I don't think it does anything anymore but it's not harmful. So yeah we could do that for Lit too.
  2. Great call! There also some examples that use @astrojs/tailwind and some anchors should be renamed I think.

I checked in VSCode, the following pages uses either a link to the integration page, Tailwind integration as anchor or @astrojs/tailwind in a code snippet:

  • /en/upgrade-astro.mdx
  • /en/guides/fonts.mdx
  • /en/guides/integrations-guide/index.mdx
  • /en/guides/migrate-to-astro/from-create-react-app.mdx
  • /en/guides/migrate-to-astro/from-gatsby.mdx
  • /en/guides/migrate-to-astro/from-nextjs.mdx
  • /en/reference/configuration-reference.mdx (this one should be updated in core)

There also two upgrade guides that use @astrojs/tailwind... (v2 and v3) but not sure if we should update them...

Regarding the link, yeah it could be better if npx astro add tailwind takes care of all the steps for the user (only adding @import 'tailwindcss'; is manual, right?). I don't have a strong opinion here...

@sarah11918
Copy link
Member

Just quickly in general, we should probably still have some of the "usage" content on the Styling page now!

It's a little extreme to just essentially mic drop TAILWIND then run away 😅

People still want to know about using Tailwind. Do they need a config file? If so, what goes in there? Do they need to import anything into files, or just write their class names? Are there caveats or pitfalls when combining Tailwind with other CSS? Can you also import and use CSS regularly?

So, my suggestion is to take some of the meaningful/helpful usage content from the Tailwind page and put it in this Tailwind section!

Thoughts welcome on exactly which content that is!

@sarah11918 sarah11918 added this to the 5.2.0 milestone Jan 27, 2025
@florian-lefebvre
Copy link
Member Author

I think it's important to mention at least the following:

  • you need a css file with @import "tailwindcss";. This acts as a config file now
  • you need to import this css file on the page where you want it to apply. That will often be a shared layout

@sarah11918 sarah11918 removed the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Jan 28, 2025
@sarah11918
Copy link
Member

@florian-lefebvre Can you add those items back then? I can always polish it up, but it's helpful if you add the content first!

* The [Astro Ink](https://github.com/one-aalam/astro-ink), [Sarissa Blog](https://github.com/iozcelik/SarissaBlogAstroStarter), [Astro Tech Blog](https://github.com/nicdun/astro-tech-blog) and [Creek](https://github.com/robertguss/Astro-Theme-Creek) themes use Tailwind for styling
* [Browse Astro Tailwind projects on GitHub](https://github.com/search?q=%22%40astrojs%2Ftailwind%22%3A+path%3A%2Fpackage.json\&type=code) for more examples!

## Troubleshooting
Copy link
Member

Choose a reason for hiding this comment

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

@florian-lefebvre Just checking, do any of these troubleshooting things about @apply still apply in v4?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is still relevant, although the tailwind config example isn't correct anymore: https://tailwindcss.com/docs/adding-custom-styles#adding-component-classes

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Looks great! Some small suggestions, and just wanted to check on some of the stuff being removed and not coming back (but if we remove too much, people will let us know and we can always add more later!) 🙌

src/content/docs/en/guides/styling.mdx Outdated Show resolved Hide resolved
src/content/docs/en/guides/styling.mdx Outdated Show resolved Hide resolved
src/content/docs/en/guides/styling.mdx Show resolved Hide resolved
Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

A few nits, after those LGTM!

src/content/docs/en/guides/fonts.mdx Outdated Show resolved Hide resolved
src/content/docs/en/recipes/tailwind-rendered-markdown.mdx Outdated Show resolved Hide resolved
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Amazing! Thank you so much for this @florian-lefebvre and catching all the stuff in the other files. Nicely done!

@sarah11918 sarah11918 added minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! labels Jan 28, 2025
@sarah11918 sarah11918 changed the base branch from main to 5.2.0 January 29, 2025 19:06
@sarah11918 sarah11918 merged commit 8b0b65b into 5.2.0 Jan 29, 2025
5 of 6 checks passed
@sarah11918 sarah11918 deleted the feat/tailwind-v4 branch January 29, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants