Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Shadows in TailwindCSS

Shadows in TailwindCSS

? Shadows in Tailwind CSS

Tailwind provides a set of predefined box-shadow utilities to add shadows to elements, enhancing depth and layering effects.


Common Shadow Classes

ClassCSS EquivalentDescription
shadow-smbox-shadow: 0 1px 2px rgba(...)Small, subtle shadow
shadowbox-shadow: 0 1px 3px rgba(...)Default shadow
shadow-mdMedium shadowSlightly bigger shadow
shadow-lgLarge shadowBigger, more prominent shadow
shadow-xlExtra large shadowStrong shadow
shadow-2xlExtra extra large shadowVery strong shadow
shadow-innerInner shadowShadow inside element
shadow-noneNo shadowRemoves shadow

Example Usage:

<div class="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md">  This card has a medium shadow.</div>

Customizing Shadows

You can extend or override shadows in your tailwind.config.js if you want custom shadow styles.

Example:

module.exports = {  theme: {    extend: {      boxShadow: {        'custom-light': '0 2px 4px rgba(0, 0, 0, 0.1)',        'custom-dark': '0 4px 6px rgba(0, 0, 0, 0.6)',      }    }  }}

Then use it like:

<div class="shadow-custom-light">  Custom light shadow</div>

Responsive and State Variants

You can combine shadows with responsive prefixes and states:

<div class="shadow hover:shadow-lg md:shadow-xl">  Hover to see bigger shadow, larger shadow on medium screens</div>

Want me to show you shadow examples on cards or buttons?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql