2 ms·
This is like repeating code without using a function. If you have a nice abstraction - the same becomes cleaner like below. <div class="group card"> <div cl
by murukesh_s 1y ago
This is like repeating code without using a function. If you have a nice abstraction - the same becomes cleaner like below.
<div class="group card">
<div class="flex items-center justify-between mb-4">
<h3 class="card-title">Team Settings</h3>
</div>
<p class="card-description">
Manage your team permissions, invites, roles, and integrations here. Changes apply instantly across all team workspaces.
</p>
<div class="flex flex-col sm:flex-row gap-4 sm:justify-end">
<button class="btn btn-cancel">Cancel</button>
<button class="btn btn-save">Save Changes</button>
</div>
</div>
- interstice 1y agoIsn't this abstraction essentially just.. creating classes?
- gloosx 1y agoSuch a pleasure to see a nice tailwind abstraction, at some point inlining starts looking just a bit too much, luckily there is a solution ;) /\* tailwind.css \*/ .card-container { @apply flex flex-col md:flex-row items-center justify-between w-full max-w-screen-xl px-6 md:px-12 py-8 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-md space-y-6 md:space-y-0 md:space-x-8 text-sm text-gray-700 dark:text-gray-300 font-medium tracking-tight leading-relaxed hover:bg-gray-50 dark:hover:bg-gray-800 transition-all duration-300 ease-in-out; }