#170 Maintainable Buttons CSS

04/06/2024
Free
css tailwindcss

Please, don't abstract button CSS into a component! It leads to suffering. Don't do this: https://github.com/baoagency/polaris_view_components/blob/main/app/components/polaris/headless_button.rb

Using inline styles for buttons with Tailwind is also a bad option, because it can be hard for you to update the component everywhere in your app at once.

CSS abstractions with an API similar to Boostrap should be just enough: https://getbootstrap.com/docs/5.3/components/buttons/#sizes

Episode source code: https://github.com/corsego/138-tailwind-layout/commit/2cd22a45bbed2c79ece73cb7726c4a181ddff5ba
Based on this blogpost: https://blog.corsego.com/tailwindcss-buttons

1
Sign in to join the conversation