Skip to content

Instantly share code, notes, and snippets.

@justalever
Last active July 29, 2024 11:13
Show Gist options
  • Save justalever/a5047b4acf3949bf355e2e36b17fb9f2 to your computer and use it in GitHub Desktop.
Save justalever/a5047b4acf3949bf355e2e36b17fb9f2 to your computer and use it in GitHub Desktop.
Tailwind button fix
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "./components/buttons.css";
@import "tailwindcss/utilities";
.btn {
@apply font-semibold text-lg py-3 px-6 rounded cursor-pointer no-underline;
}
.btn-small {
@apply font-bold rounded text-sm py-2 px-4;
}
.btn-indigo {
@apply bg-indigo-600 text-white hover:bg-indigo-700;
}
.btn-green {
@apply bg-emerald-600 text-white hover:bg-emerald-700;
}
.btn-outline {
@apply border border-gray-400 text-gray-800 bg-white hover:bg-gray-100;
}
.btn-white {
@apply bg-white text-gray-800 py-2 px-4 rounded border-gray-400 shadow-sm shadow-gray-50;
}
@justalever
Copy link
Author

Couple of notes:

  • For the application.tailwind.css file, it's recommended that you include any additional component-driven styles after the components are included from Tailwind directly.
  • There were a couple of typos in the buttons.css file. I fixed those above. In your views, I saw there are .btn-small and .btn-sm variants, so you'll need to choose one strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment