Agyan
adda
Run
Reset
Copy
Tailwind CSS Tutorial › Tailwind Customization › Brand colours, font and animation with @theme
Back to tutorial
Code
Edit, then press Run or Ctrl+Enter
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> <style type="text/tailwindcss"> @theme { --color-brand: #1f386b; --color-accent: #e8590c; --font-display: Georgia, serif; --animate-wiggle: wiggle 0.6s ease-in-out infinite; @keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } } } </style> <div class="p-8 space-y-4"> <h1 class="font-display text-4xl text-brand">AgyanAdda Brand</h1> <p class="text-slate-600">These classes were created from our own theme variables.</p> <button class="bg-brand hover:bg-brand/90 text-white px-5 py-2 rounded-lg">bg-brand</button> <button class="bg-accent text-white px-5 py-2 rounded-lg hover:animate-wiggle">Hover: animate-wiggle</button> </div>
Result