Resultado del Reto:
HTML
<h1 class="text-2xl mt-10">Colores y Dimensiones</h1>
<button class="bg-blue-800 text-blue-200 py-2 px-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
<h1 class="text-2xl mt-10">Display y Flexbox</h1>
<div class="flex flex-wrap">
<button class="bg-blue-800 text-blue-200 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
<button class="bg-blue-800 text-blue-200 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
<button class="bg-blue-800 text-blue-200 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
</div>
<h1 class="text-2xl mt-10">Pseudo—Class Variants</h1>
<p>Nota: en Variants se agrega 'active' a backgroundColor y textColor</p>
<div class="flex flex-wrap">
<button class="hover:bg-blue-800 hover:text-blue-200 active:bg-blue-600 focus:bg-blue-800 focus:text-blue-200 focus:outline-none focus:shadow-outline bg-blue-200 text-blue-800 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
<button class="hover:bg-blue-800 hover:text-blue-200 active:bg-blue-600 focus:bg-blue-800 focus:text-blue-200 focus:outline-none focus:shadow-outline bg-blue-200 text-blue-800 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
<button class="hover:bg-blue-800 hover:text-blue-200 active:bg-blue-600 focus:bg-blue-800 focus:text-blue-200 focus:outline-none focus:shadow-outline bg-blue-200 text-blue-800 py-2 px-5 ml-5 mt-5 rounded w-full sm:w-48">
Submit
</button>
</div>
<h1 class="text-2xl mt-10">Extraer componentes usando @apply</h1>
<div class="flex flex-wrap">
<div class="alert alert-default">
Este mensaje es una alerta default.
</div>
<div class="alert alert-danger">
Este mensaje es una alerta danger.
</div>
<div class="alert alert-warning">
Este mensaje es una alerta warning.
</div>
<div class="alert alert-info">
Este mensaje es una alerta info.
</div>
</div>
TailwindCSS
.alert {
@apply py-2 px-4 mt-5 ml-5 rounded;
}
.alert-default {
@apply bg-gray-100 text-gray-700 border border-gray-400;
}
.alert-danger {
@apply bg-red-100 text-red-700 border border-red-400;
}
.alert-warning {
@apply bg-orange-100 text-orange-700 border border-orange-400;
}
.alert-info {
@apply bg-blue-100 text-blue-700 border border-blue-400;
}
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?