#170 Maintainable Buttons CSS

04/06/2024
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
Join the conversation
Sign in to access PRO lessons, access private repos, leave comments, create watch lists.
We collect your email address, name and username to create your account. We do not share your email address with anyone else.