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

chore(docs): bump to tailwind 4.0 #1327

Merged
merged 1 commit into from
Jan 29, 2025
Merged

chore(docs): bump to tailwind 4.0 #1327

merged 1 commit into from
Jan 29, 2025

Conversation

iainlane
Copy link
Member

@iainlane iainlane commented Jan 27, 2025

This is a new major version of Tailwind CSS, which includes a lot of breaking changes. This commit updates the project to use the new version.

A lot of changes were required to accommodate this. We drop the @astrojs/tailwind plugin since it's not been ported to 4.0 yet. What that does is bridge between Starlight and Tailwind, and this is something we can do manually by taking the few definitions that are needed.

As this implies, the way Tailwind works has changed a fair bit. There's no Javascript config file any more - it's all done in CSS instead. So the configuration has had an overhaul.

Some of the classes have changed too. This, and the dropping of the plugin, meant that the styles broke a bit. We have ported to be more Tailwind-native to fix this. This means dropping most of the inline css <style> blocks in our components and using the Tailwind native utililty classes instead. The notable exception is the TableOfContentsList component which is quite custom and so is left for later.

There are some minor visual differences but overall it should look broadly the same.

Finally, we've installed some Prettier plugins for Astro and Tailwind, and ran the code through them.

@iainlane iainlane marked this pull request as ready for review January 27, 2025 17:37
@iainlane iainlane requested a review from a team as a code owner January 27, 2025 17:37
@iainlane iainlane marked this pull request as draft January 27, 2025 17:37
@iainlane iainlane removed the request for review from a team January 27, 2025 17:37
@iainlane iainlane force-pushed the iainlane/tailwind-4 branch from 40b4977 to cf425bd Compare January 28, 2025 10:42
Copy link
Contributor

github-actions bot commented Jan 28, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-01-29 10:01 UTC

@iainlane iainlane force-pushed the iainlane/tailwind-4 branch 4 times, most recently from 5fbe1ed to f6cc2ed Compare January 28, 2025 19:52
This is [a new major version of Tailwind CSS][release-announcement],
which includes a lot of breaking changes. This commit updates the
project to use the new version.

A lot of changes were required to accommodate this. We drop the
`@astrojs/tailwind` plugin since it's not been ported to 4.0 yet. What
that does is bridge between Starlight and Tailwind, and this is
something we can do manually by taking the few definitions that are
needed.

As this implies, the way Tailwind works has changed a fair bit. There's
no Javascript config file any more - it's all done in CSS instead. So
the configuration has had an overhaul.

Some of the classes have changed too. This, and the dropping of the
plugin, meant that the styles broke a bit. We have ported to be more
Tailwind-native to fix this. This means dropping most of the inline css
`<style>` blocks in our components and using the Tailwind native
utililty classes instead. The notable exception is the
`TableOfContentsList` component which is quite custom and so is left for
later.

There are some minor visual differences but overall it should look
broadly the same.

Finally, we've installed some Prettier plugins for Astro and Tailwind,
and ran the code through them.

[release-announcement]: https://blog.tailwindcss.com/tailwindcss-v4
@iainlane iainlane force-pushed the iainlane/tailwind-4 branch from f6cc2ed to 4987d8e Compare January 28, 2025 19:57
@iainlane iainlane marked this pull request as ready for review January 28, 2025 19:58
@iainlane iainlane requested a review from a team January 28, 2025 20:00
Copy link
Contributor

@zerok zerok 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! Thank you for doing this!

Just some minor things I've noticed:

  • On mobile I noticed different padding in the top-nav bar
  • The "Kubernetes" and "Jsonnet" links on the frontpage have a different color (now orange, previously purple/blue). IMO the new color is better.

Both are fine IMO 🙂

@iainlane
Copy link
Member Author

Yeah I thought the orange was nicer and a bit more consistent 😁

thanks!

@iainlane iainlane added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit 6c5d340 Jan 29, 2025
22 checks passed
@iainlane iainlane deleted the iainlane/tailwind-4 branch January 29, 2025 10:00
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.

2 participants