Box Shadow

    Outer shadow

    Use the , shadow, shadow-md, shadow-lg, shadow-xl, or shadow-2xl utilities to apply different sized outer box shadows to an element.

    Use the shadow-inner utility to apply a subtle inset box shadow to an element. This can be useful for things like form controls or wells.

    Box Shadow - 图2

    1. <div class="shadow-inner ..."></div>

    No shadow

    To control the shadow of an element at a specific breakpoint, add a {screen}: prefix to any existing shadow utility. For example, use md:shadow-lg to apply the utility at only medium screen sizes and above.

    1. <div class="shadow md:shadow-lg ...">
    2. <!-- ... -->
    3. </div>

    For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.

    Customizing

    By default, Tailwind provides six drop shadow utilities, one inner shadow utility, and a utility for removing existing shadows. You can change, add, or remove these by editing the theme.boxShadow section of your Tailwind config.

    By default, only responsive, group-hover, focus-within, hover and focus variants are generated for box shadow utilities.

    You can control which variants are generated for the box shadow utilities by modifying the boxShadow property in the variants section of your file.

    For example, this config will also generate active variants:

    1. module.exports = {
    2. variants: {
    3. extend: {
    4. // ...
    5. + boxShadow: ['active'],
    6. }
    7. }

    If you don’t plan to use the box shadow utilities in your project, you can disable them entirely by setting the boxShadow property to in the corePlugins section of your config file:

    Edit this page on GitHub