Tailwind Organize Components CSS File

Jan 6, 2023

Create assets/styles/main.css

@import "./tailwind.css";@import "./components/t-chip.css";@import "./components/t-button.css";@import "./components/t-breadcrumb.css";@import "./components/t-pagination.css";

Create assets/styles/tailwind.css

@tailwind base;@tailwind components;@tailwind utilities;@layer base {  h1 {    @apply text-4xl;  }  h2 {    @apply text-3xl;  }  h3 {    @apply text-2xl;  }  a {    @apply t-link;  }  a.no-link {    @apply text-inherit no-underline hover:underline;  }  a.button-link {    @apply text-inherit no-underline hover:no-underline;  }}@layer components {  .t-link {    @apply underline text-blue-600 hover:text-blue-800  }  .t-inline-container {    @apply inline-flex flex-wrap gap-x-2 gap-y-1  }}

Create assets/styles/components/t-chip.css

@layer components {  .t-chip-container {      @apply inline-flex flex-wrap gap-x-2 gap-y-1  }  .t-chip {      @apply px-2 py-1 rounded-lg bg-gray-300   }  .t-chip-light {      @apply bg-gray-100  }  .t-chip-small {      @apply text-xs font-medium  }}

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.