Bird
Raised Fist0
Tailwindmarkup~20 mins

Drop shadow on irregular shapes in Tailwind - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Drop Shadow Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
Which Tailwind class adds a drop shadow to an irregular shape?
You have an irregular shape created with an SVG inside a div. Which Tailwind CSS class will add a visible drop shadow around the shape?
Tailwind
<div class="w-40 h-40">
  <svg viewBox="0 0 100 100" class="w-full h-full">
    <path d="M10 30 Q 50 5 90 30 T 90 80 Q 50 95 10 80 Z" fill="#4ade80" />
  </svg>
</div>
Ashadow-lg
Bborder-4
Cbg-gray-200
Dring-4 ring-gray-500
Attempts:
2 left
💡 Hint
Drop shadows in Tailwind use the shadow-* classes.
🧠 Conceptual
intermediate
2:00remaining
Why might a drop shadow not appear on an irregular SVG shape with Tailwind's shadow class?
You applied the shadow-lg class to a div containing an SVG irregular shape, but no shadow is visible. What is the most likely reason?
AThe shadow-lg class requires a background color to show the shadow.
BTailwind shadows only work on text elements, not SVGs.
CThe SVG shape has transparent background and the shadow applies only to the div's rectangular box.
DThe SVG path must have a stroke color for shadows to appear.
Attempts:
2 left
💡 Hint
Think about how shadows apply to the container box, not the shape inside.
📝 Syntax
advanced
2:00remaining
Which Tailwind utility correctly applies a custom drop shadow with offset and blur?
You want a drop shadow with 4px horizontal offset, 6px vertical offset, 10px blur, and black color at 50% opacity. Which Tailwind class syntax is correct?
Ashadow-[rgba(0,0,0,0.5)_4px_6px_10px]
Bshadow-[4px_6px_10px_rgba(0,0,0,0.5)]
Cdrop-shadow-[4px_6px_10px_rgba(0,0,0,0.5)]
Dshadow-custom(4px,6px,10px,rgba(0,0,0,0.5))
Attempts:
2 left
💡 Hint
Tailwind supports arbitrary values inside square brackets with underscores for spaces.
selector
advanced
2:00remaining
Which CSS selector targets only irregular SVG shapes inside a div with Tailwind?
You want to apply a drop shadow only to SVG elements inside a div with class 'shape-container'. Which selector is correct?
Asvg.path.shape-container
B.shape-container > svg > path
Cdiv.shape-container path:first-child
D.shape-container path
Attempts:
2 left
💡 Hint
Think about selecting all path elements inside the container, no matter how nested.
accessibility
expert
2:00remaining
How to ensure drop shadow on irregular shapes does not reduce accessibility?
You added a drop shadow to an irregular SVG shape for decoration. What is the best practice to keep your site accessible?
AUse aria-hidden="true" on the SVG and provide descriptive text elsewhere.
BAdd a bright colored shadow to improve contrast for all users.
CRemove the shadow on focus to avoid distraction.
DUse drop shadow only on clickable elements with aria-label.
Attempts:
2 left
💡 Hint
Decorative elements should not confuse screen readers.

Practice

(1/5)
1. What is the main purpose of using a drop shadow on irregular shapes in Tailwind CSS?
easy
A. To add depth and make the shape stand out visually
B. To change the shape's color
C. To make the shape larger
D. To remove the shape's border

Solution

  1. Step 1: Understand drop shadow effect

    Drop shadows create a shadow behind an element, giving it a sense of depth.
  2. Step 2: Apply to irregular shapes

    Using drop shadows on irregular shapes helps them visually pop from the background.
  3. Final Answer:

    To add depth and make the shape stand out visually -> Option A
  4. Quick Check:

    Drop shadow purpose = add depth [OK]
Hint: Drop shadows make shapes look lifted and clear [OK]
Common Mistakes:
  • Thinking drop shadows change color
  • Confusing drop shadows with resizing
  • Assuming drop shadows remove borders
2. Which Tailwind CSS class correctly applies a custom drop shadow with a blur radius of 5px and offset of 3px 3px?
easy
A. drop-shadow-3-3-5
B. shadow-3px-3px-5px
C. shadow-custom(3px,3px,5px)
D. shadow-[drop-shadow(3px_3px_5px_rgba(0,0,0,0.5))]

Solution

  1. Step 1: Recognize Tailwind custom shadow syntax

    Tailwind uses square brackets for custom CSS values, e.g., shadow-[drop-shadow(...)]
  2. Step 2: Match the correct CSS drop-shadow format

    The correct CSS function is drop-shadow(offsetX offsetY blurRadius color), here 3px 3px 5px rgba(0,0,0,0.5)
  3. Final Answer:

    shadow-[drop-shadow(3px_3px_5px_rgba(0,0,0,0.5))] -> Option D
  4. Quick Check:

    Custom drop shadow syntax = shadow-[drop-shadow(...)] [OK]
Hint: Use square brackets with drop-shadow(...) inside shadow- class [OK]
Common Mistakes:
  • Missing square brackets for custom values
  • Using invalid class names without brackets
  • Confusing drop-shadow with shadow utilities
3. Given this HTML and Tailwind CSS snippet:
<div class="w-40 h-40 bg-blue-500 clip-path-[polygon(50%_0%,100%_50%,50%_100%,0%_50%)] shadow-[drop-shadow(4px_4px_6px_rgba(0,0,0,0.4))]"></div>

What will you see rendered in the browser?
medium
A. A blue square with no shadow
B. A blue diamond shape with a soft shadow offset to bottom-right
C. A blue circle with a sharp shadow
D. A blue triangle with a shadow on top-left

Solution

  1. Step 1: Analyze clip-path polygon points

    The polygon points create a diamond shape by connecting top, right, bottom, and left midpoints.
  2. Step 2: Understand drop shadow parameters

    The drop shadow is offset 4px right and 4px down with a 6px blur and semi-transparent black color, creating a soft shadow bottom-right.
  3. Final Answer:

    A blue diamond shape with a soft shadow offset to bottom-right -> Option B
  4. Quick Check:

    clip-path diamond + drop shadow offset = diamond with shadow [OK]
Hint: Polygon points define shape; drop-shadow offsets shadow direction [OK]
Common Mistakes:
  • Ignoring clip-path shape and expecting a square
  • Confusing shadow offset direction
  • Assuming circle shape from polygon
4. You wrote this Tailwind class for an irregular shape shadow:
shadow-[drop-shadow(5px 5px 10px rgba(0,0,0,0.3))]
But the shadow does not appear. What is the likely issue?
medium
A. Spaces inside square brackets should be replaced with underscores
B. The rgba color is invalid
C. Drop shadow does not work with clip-path
D. The shadow class must be placed on a parent element

Solution

  1. Step 1: Check Tailwind custom class syntax

    Tailwind requires no spaces inside square brackets for custom values; spaces must be replaced with underscores.
  2. Step 2: Confirm correct syntax for drop-shadow

    Correct syntax is shadow-[drop-shadow(5px_5px_10px_rgba(0,0,0,0.3))] with underscores instead of spaces.
  3. Final Answer:

    Spaces inside square brackets should be replaced with underscores -> Option A
  4. Quick Check:

    Custom class spaces = underscores [OK]
Hint: Replace spaces with underscores inside custom bracket classes [OK]
Common Mistakes:
  • Leaving spaces inside square brackets
  • Assuming rgba color is wrong
  • Thinking drop shadow can't be used with clip-path
5. You want to create a star shape with a drop shadow using Tailwind CSS. Which combination of classes correctly applies a star clip-path and a subtle drop shadow offset to the bottom-right?
hard
A. clip-path-star shadow-[drop-shadow(4px_4px_10px_rgba(0,0,0,0.5))]
B. clip-star shadow-drop(2px_2px_4px_rgba(0,0,0,0.25))
C. clip-path-[polygon(50%_0%,61%_35%,98%_35%,68%_57%,79%_91%,50%_70%,21%_91%,32%_57%,2%_35%,39%_35%)] shadow-[drop-shadow(2px_2px_4px_rgba(0,0,0,0.25))]
D. clip-polygon-star shadow-[drop-shadow(0_0_0_rgba(0,0,0,0))]

Solution

  1. Step 1: Identify correct clip-path polygon for star

    The polygon points in clip-path-[polygon(50%_0%,61%_35%,98%_35%,68%_57%,79%_91%,50%_70%,21%_91%,32%_57%,2%_35%,39%_35%)] shadow-[drop-shadow(2px_2px_4px_rgba(0,0,0,0.25))] define a star shape using percentages and underscores for spaces.
  2. Step 2: Check drop shadow syntax and subtlety

    clip-path-[polygon(50%_0%,61%_35%,98%_35%,68%_57%,79%_91%,50%_70%,21%_91%,32%_57%,2%_35%,39%_35%)] shadow-[drop-shadow(2px_2px_4px_rgba(0,0,0,0.25))] uses shadow-[drop-shadow(2px_2px_4px_rgba(0,0,0,0.25))], a subtle shadow offset bottom-right with correct syntax.
  3. Final Answer:

    clip-path-polygon star with subtle drop shadow using underscores -> Option C
  4. Quick Check:

    Star shape + correct drop shadow syntax = clip-path-[polygon(50%_0%,61%_35%,98%_35%,68%_57%,79%_91%,50%_70%,21%_91%,32%_57%,2%_35%,39%_35%)] shadow-[drop-shadow(2px_2px_4px_rgba(0,0,0,0.25))] [OK]
Hint: Use polygon points with underscores and subtle rgba shadow [OK]
Common Mistakes:
  • Using invalid class names like clip-star
  • Incorrect drop shadow syntax without brackets
  • No shadow or zero offset shadow