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

fix: pin tailwind to version used in production #2528

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

travis
Copy link
Contributor

@travis travis commented Mar 26, 2024

I've been trying to get the file list in the my development version working, and was struggling even after pointing the website at the production version.

It turns out that when this website was updated from Tachyons to Tailwind, a stray collapse style was left on the file list table:

1a29aa9#diff-f8b81b815feea0a351b1a42218602943bda2f0d4cd44b009dbbbb5f7c8c35ddaR462

At the time this was fine! Tailwind didn't have a collapse style until version 3.2 and 3.0/3.1 were current at the time of the transition. The production site uses Tailwind 3.1 and works just fine.

However! The version specification for the tailwind package in the website project's package.json uses a "compatible with version" specifier (https://stackoverflow.com/a/22345808) which will bring in new minor versions as they're released, so my development version used Tailwind 3.4 which does have a collapse style that is unfortunately very different from the Tachyon style - rather than mapping to the border-collapse: collapse style as Tachyon does, collapse in Tailwind translates to visibility: collapse - a CSS attribute intended to let developers hide specific table rows. When applied to a whole table it results in the entire table being hidden. This was the source of the bug.

This PR:

  1. moves to the border-collapse Tailwind style to match the original intent
  2. pins Tailwind to the version specified in yarn.lock and any patch releases (which should not introduce or remove new styles)

I've been trying to get the file list in the my development version working,
and was struggling even after pointing the website at the production version.

It turns out that when this website was updated from Tachyons to Tailwind, a stray `collapse` style was left on the file list table:

nftstorage@1a29aa9#diff-f8b81b815feea0a351b1a42218602943bda2f0d4cd44b009dbbbb5f7c8c35ddaR462

At the time this was fine! Tailwind didn't have a `collapse` style until version 3.2 and 3.0/3.1 were current at the time of the transition. The production site uses Tailwind 3.1 and works just fine.

However! The version specification for the `tailwind` package in the `website` project's package.json uses a "compatible with version" specifier (https://stackoverflow.com/a/22345808) which will bring in new minor versions as they're released, so my development version used Tailwind 3.4 which _does_ have a `collapse` style that is unfortunately _very different from the Tachyon style_ - rather than mapping to the `border-collapse: collapse` style as Tachyon does, `collapse` in Tailwind translates to `visibility: collapse` - a CSS attribute intended to let developers hide specific table rows. When applied to a whole table it results in the entire table being hidden. This was the source of the bug.

This PR:

1) moves to the `border-collapse` Tailwind style to match the original intent
2) pins Tailwind to the version specified in `yarn.lock` and any patch releases (which should not introduce or remove new styles)
Copy link
Contributor

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

wow, amazing work.

@travis travis merged commit 64239e7 into nftstorage:main Mar 28, 2024
20 checks passed
alanshaw pushed a commit that referenced this pull request Apr 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.9.0](website-v2.8.5...website-v2.9.0)
(2024-04-04)


### Features

* POST /uploads can write uploads to w3up for web3 serving and
dagcargoless filecoin deal-making
([#2522](#2522))
([0c77cb3](0c77cb3))


### Bug Fixes

* pin tailwind to version used in production
([#2528](#2528))
([64239e7](64239e7))
* use correct API URL for classic.nft.storage
([#2558](#2558))
([cca7d5b](cca7d5b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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