rails / tailwindcss-rails

MIT License
1.39k stars 171 forks source link

May be time to remove @tailwindcss/aspect-ratio #344

Closed searls closed 5 months ago

searls commented 5 months ago

This gem includes all of Tailwind's 1st-party plugins, which I think is/was a smart choice, but I just tripped over the fact that @tailwindcss/aspect-ratio doesn't behave like the docs in that aspect-video was doing nothing.

After futzing around for a bit, I realized the gem installs and configures the aspect-ratio plugin, and that was the cause of my issue. Since the plugin was apparently created as a polyfill until Safari 15 released (which did release back in Fall 2021), I think it's probably safe for it to be EOL'd for anyone who isn't targeting ancient browsers

Thoughts?

flavorjones commented 5 months ago

@searls Thanks for bringing this up. I agree that it's probably time to assume the plugin is probably not useful for more folks.

After a brief read through the plugin's docs, I'm not confident that I know how to make this change in a backwards-compatible way that won't break any existing apps (in particular there seems to be a set of aspectRatio values set by the plugin that aren't set in the core utility); but I don't use this feature set.

If you're comfortable with it, I'd love to see a PR that folks could use and give feedback on.

searls commented 5 months ago

Well, the biggest concern for me is that the installer will generate a tailwind.config.js that has this plugin listed in it, so any PR that removed the plugin would also break all those generated config files since the require would fail

As a result, I think the least disruptive thing to do would be to remove this line so new installs don't get it by default. Sound good?

agrberg commented 3 months ago

For folks coming here wondering why aspect-video doesn't appear to add the proper class you likely started on tailwindcss-rails prior to this change and you need to remove require("@tailwindcss/aspect-ratio"), from config/tailwind.config.js. Ask me how I know 😉

richjdsmith commented 3 months ago

@agrberg thank you. I was on the path to baldness for all the hair pulling I was doing before this comment.