style: Use primary Tailwind colors for sort buttons
This commit is contained in:
1 parent
005cafd0c8
commit
5423ded939
1 file changed
+10
-6
@@ -26,8 +26,8 @@
|
|||||||
<!-- Sort By -->
|
<!-- Sort By -->
|
||||||
<div class="sort-controls flex items-center space-x-2">
|
<div class="sort-controls flex items-center space-x-2">
|
||||||
<span class="text-sm font-medium text-gray-700 mr-2">Sort by:</span>
|
<span class="text-sm font-medium text-gray-700 mr-2">Sort by:</span>
|
||||||
<button data-sort-by="new" class="sort-btn active px-3 py-1 text-sm font-action bg-white border border-gray-300 rounded-md hover:bg-gray-50">New</button>
|
<button data-sort-by="new" class="sort-btn active px-3 py-1 text-sm font-action bg-primary text-white rounded-md hover:bg-primary-dark transition-colors duration-150 ease-in-out">New</button>
|
||||||
<button data-sort-by="top" class="sort-btn px-3 py-1 text-sm font-action bg-white border border-gray-300 rounded-md hover:bg-gray-50">Top</button>
|
<button data-sort-by="top" class="sort-btn px-3 py-1 text-sm font-action bg-primary text-white rounded-md hover:bg-primary-dark transition-colors duration-150 ease-in-out">Top</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,11 +150,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
sortButtons.forEach(btn => {
|
sortButtons.forEach(btn => {
|
||||||
btn.classList.toggle('active', btn.dataset.sortBy === currentSort);
|
const isActive = btn.dataset.sortBy === currentSort;
|
||||||
if (btn.dataset.sortBy === currentSort) {
|
btn.classList.toggle('active', isActive);
|
||||||
btn.classList.add('bg-blue-200', 'border-blue-400'); // Example active style
|
// Make active sort button slightly darker (using primary-dark)
|
||||||
|
if (isActive) {
|
||||||
|
btn.classList.remove('bg-primary');
|
||||||
|
btn.classList.add('bg-primary-dark');
|
||||||
} else {
|
} else {
|
||||||
btn.classList.remove('bg-blue-200', 'border-blue-400');
|
btn.classList.remove('bg-primary-dark');
|
||||||
|
btn.classList.add('bg-primary');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user