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

Fixing bug that could lose Tailwind's default presets #3099

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

tony-sull
Copy link
Contributor

@tony-sull tony-sull commented Apr 13, 2022

Changes

Closes #3043

@astrojs/tailwind was defaulting presets to [] which actually tells Tailwind to remove the default presets of colors, sizes, etc.

This change removes the applyAstroConfigPreset option, instead of our own custom flag users can disable the built-in preset in the Tailwind config as usual by including presets: [] themselves

Testing

  • Tailwind test updated to make sure custom colors are included in the build
  • Tested locally with astro.build, which has a pretty extensive tailwind.config.js

Docs

Updated the integration README (no docs site updates needed)


Bug details

Forcing presets: undefined in our default Tailwind config makes sure that the presets are enabled by default. What was happening in #3043 is that the user config customized the theme and didn't include the presets config option (pretty normal not to use that option). Our integration ended up with a customized theme and presets: [], which inadvertantly threw out all Tailwind presets.

With this update, users can use their own Tailwind config file to disable presets if they really need to

@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2022

🦋 Changeset detected

Latest commit: 3dd7473

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/tailwind Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) test labels Apr 13, 2022
@tony-sull tony-sull marked this pull request as draft April 13, 2022 10:55
@tony-sull tony-sull marked this pull request as ready for review April 13, 2022 11:12
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

lgtm

@tony-sull tony-sull merged commit 254a8f3 into main Apr 13, 2022
@tony-sull tony-sull deleted the fix/tailwind-presets branch April 13, 2022 15:05
@github-actions github-actions bot mentioned this pull request Apr 13, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* fixing bug that could lose Tailwind's default presets

* updating integration README

* chore: adding changeset

* test: fixing the tailwind tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Tailwind custom colours don't get applied
2 participants