Recap: Layered Surfaces
Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 45 of 55.
Challenge
HardBuild a locally layered reservation card. Its root is relative and isolated. Put a full-card decorative frame at stacking level 20, aria-hidden and ignoring pointer events. Keep the positioned content at level 10 and the status badge at level 30, 8px from top and right. Preserve the supplied top padding and native Reserve button; clicking it must update the supplied counter.
Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<article id="card" class="w-80 h-40 relative"><div id="frame" aria-hidden="true" class="absolute inset-0 border-4 z-20"></div><section id="content" class="relative pt-10 z-0"><h2>Weekend studio</h2><button id="action">Reserve</button></section><span id="badge" class="static">Open</span></article><output id="count">0</output>
<script src="./controls.js"></script>
</body></html>
All lessons in Responsive UI Patterns
1Page Shells
Growing Page ShellsFlexible Content RailsBounded Scroll RegionsFull-Bleed RegionsRecap: Page Shells4Form Layouts
Responsive Field GroupsFocused Field GroupsSelectable Form OptionsNative Validation CuesRecap: Form Layouts2Navigation Patterns
Wrapping NavigationCurrent Page CuesNative Menu DisclosuresKeyboard Skip LinksRecap: Navigation5Data Tables
Scrollable Data TablesPredictable Table ColumnsRow State PresentationSticky Table HeadersRecap: Data Tables8Interactive Panels
Expanded Control CuesChoice Card StatesFocus-Aware Help PanelsContent-Aware Empty StatesRecap: Interactive Panels11Project: Event Portal
Portal ShellSession Browser3Content Cards
Aligned Card ActionsCard Media FramesResponsive Feature CardsShared Card RowsRecap: Content Cards6Container Queries
Component Width QueriesBounded Component StatesNamed Query RegionsBounded Fluid ComponentsRecap: Container Queries9Layered Surfaces
Anchored Card BadgesLocal Layer BoundariesNonblocking DecorationResponsive Sticky RailsRecap: Layered Surfaces