Apply transition (color) to category buttons (#21)

* 🔧 Add motion-reduce variant to transitionProperty

* 💄 Transition color from category buttons
This commit is contained in:
Vinicius Kiatkoski Neves
2020-11-06 07:58:11 +01:00
committed by GitHub
parent e3ef694bb3
commit a10018b4ae
2 changed files with 4 additions and 2 deletions

View File

@@ -6,7 +6,7 @@
<div class="flex items-center justify-center mt-5 ">
<div class="mt-2 md:mt-0">
<span v-for="category in categories" :key="category.name">
<button @click="searchText = category.name" class="ml-2 mt-2 px-3 py-1 cursor-pointer hover:bg-gray-700 hover:text-gray-200 rounded text-sm focus:outline-none" :class="category.name === searchText? 'bg-gray-700 text-gray-200' : 'bg-gray-200 text-gray-700'">{{ category.name }}</button>
<button @click="searchText = category.name" class="ml-2 mt-2 px-3 py-1 cursor-pointer hover:bg-gray-700 hover:text-gray-200 motion-reduce:transition-none transition-colors duration-150 ease-in-out rounded text-sm focus:outline-none" :class="category.name === searchText? 'bg-gray-700 text-gray-200' : 'bg-gray-200 text-gray-700'">{{ category.name }}</button>
</span>
</div>
</div>

View File

@@ -13,6 +13,8 @@ module.exports = {
},
},
},
variants: {},
variants: {
transitionProperty: ({ after }) => after(['motion-reduce']),
},
plugins: [],
};