Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Web and App implementation guide for Layered Design. Trigger when user wants multiple depth levels, floating panels, and overlapping content.
.claude/skills/lingxling-layered-design/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 84% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 71% | 0% |
> "Stacking context. Interfaces built from overlapping, independent layers."
Use this sub-style when the user's request matches the aesthetic described above. This is a child reference of the design-it skill and is not meant to be triggered directly.
position: absolute, negative margins, and z-index.css.layer-container { position: relative; padding: 100px; } .layer-bg-image { position: absolute; top: 0; right: 0; width: 60%; height: 400px; object-fit: cover; z-index: 1; } .layer-text-box { position: relative; z-index: 2; /* Sits above the image */ background: white; padding: 40px; width: 50%; margin-top: 200px; /* Pulls it down over the image */ box-shadow: 0 20px 40px rgba(0,0,0,0.1); /* Optional: border to define edge */ border-left: 4px solid var(--cta-highlight); }
swiftstruct LayeredDesignView: View { var body: some View { ScrollView { ZStack(alignment: .top) { // Background Image Layer (Back) Image("architectural-bg") .resizable() .aspectRatio(contentMode: .fill) .frame(height: 400) .offset(x: 40, y: 0) // Shifted right .zIndex(1) // Content Card Layer (Front) VStack(alignment: .leading, spacing: 16) { Text("Stacking Context") .font(.largeTitle).bold() Text("This card intentionally overlaps the background image to create depth without relying on a grid.") .foregroundColor(.secondary) } .padding(40) .background(Color.white) .shadow(color: Color.black.opacity(0.1), radius: 30, y: 20) .offset(x: -40, y: 200) // Shifted left and pulled down .zIndex(2) } .padding(.bottom, 200) // Account for the offset } } }
ZStack is the foundation of layered design in SwiftUI..offset() to intentionally break the alignment and create overlapping compositions..zIndex() if your offsets might cause unexpected paint orders.dartclass LayeredDesignScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: SingleChildScrollView( child: SizedBox( height: 600, // Fixed height stack or use constraints child: Stack( children: [ // Background Image Layer Positioned( top: 0, right: -40, // Shifted offscreen right width: MediaQuery.of(context).size.width * 0.8, height: 400, child: Image.asset('assets/architectural-bg.jpg', fit: BoxFit.cover), ), // Content Card Layer Positioned( top: 250, // Overlaps the bottom of the image left: 20, // Overlaps the left of the image width: MediaQuery.of(context).size.width * 0.7, child: Container( padding: const EdgeInsets.all(40), decoration: BoxDecoration( color: Colors.white, boxShadow: [ BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 30, offset: const Offset(0, 20)) ], ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: const [ Text('Stacking Context', style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold)), SizedBox(height: 16), Text('This card intentionally overlaps the background image.', style: TextStyle(color: Colors.grey)), ], ), ), ), ], ), ), ), ); } }
Stack widget with Positioned children is required.Positioned (e.g., right: -40) to bleed layers off the edge of the screen, which is a common trope in layered design.jsxconst LayeredDesignScreen = () => { return ( <ScrollView style={{ flex: 1, backgroundColor: '#F8F8F8' }}> <View style={{ height: 600 }}> {/* Background Image Layer */} <Image source={{ uri: 'https://example.com/architectural-bg.jpg' }} style={{ position: 'absolute', top: 0, right: -40, width: '80%', height: 400, zIndex: 1, }} /> {/* Content Card Layer */} <View style={{ position: 'absolute', top: 250, left: 20, width: '70%', backgroundColor: '#FFF', padding: 40, zIndex: 2, // Deep shadow to separate the layers shadowColor: '#000', shadowOffset: { width: 0, height: 20 }, shadowOpacity: 0.1, shadowRadius: 30, elevation: 15, }}> <Text style={{ fontSize: 32, fontWeight: 'bold', marginBottom: 16 }}>Stacking Context</Text> <Text style={{ color: '#666' }}>This card intentionally overlaps the background image.</Text> </View> </View> </ScrollView> ); };
position: 'absolute' inside a relative container.zIndex explicitly. Note that on Android, elevation also controls Z-indexing, so the card must have a higher elevation than the image.kotlin@Composable fun LayeredDesignScreen() { Column(modifier = Modifier.verticalScroll(rememberScrollState())) { Box(modifier = Modifier.height(600.dp).fillMaxWidth()) { // Background Image Layer Image( painter = painterResource(id = R.drawable.architectural_bg), contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier .align(Alignment.TopEnd) .offset(x = 40.dp) // Bleed off right edge .width(300.dp) .height(400.dp) .zIndex(1f) ) // Content Card Layer Box( modifier = Modifier .align(Alignment.TopStart) .offset(x = 20.dp, y = 250.dp) // Overlap the image .width(280.dp) .zIndex(2f) .shadow(30.dp) .background(Color.White) .padding(40.dp) ) { Column { Text("Stacking Context", fontSize = 32.sp, fontWeight = FontWeight.Bold) Spacer(Modifier.height(16.dp)) Text("This card intentionally overlaps the background image.", color = Color.Gray) } } } } }
Box acts as your stack.Modifier.align() to set the baseline position, then Modifier.offset() to push it out of grid alignment.Modifier.zIndex() ensures the content card always renders on top of the image.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 28,126 | 35,511 | +26% | 1 | 1 | 0% | 5,681 | 7,422 | +31% | 0 | 0 | — |
case-02 | fail→pass | 23,622 | 19,589 | -17% | 1 | 1 | 0% | 3,329 | 5,188 | +56% | 0 | 0 | — |
case-03 | pass→pass | 16,282 | 16,972 | +4% | 1 | 1 | 0% | 3,068 | 5,257 | +71% | 0 | 0 | — |
case-04 | fail→pass | 23,412 | 22,541 | -4% | 1 | 1 | 0% | 3,516 | 6,465 | +84% | 0 | 0 | — |
case-05 | fail→fail | 28,299 | 22,258 | -21% | 1 | 1 | 0% | 4,788 | 5,424 | +13% | 0 | 0 | — |
case-06 | pass→pass | 12,457 | 13,689 | +10% | 1 | 1 | 0% | 2,027 | 4,617 | +128% | 0 | 0 | — |
case-19 | fail→fail | 21,429 | 21,201 | -1% | 1 | 1 | 0% | 3,172 | 5,395 | +70% | 0 | 0 | — |
case-07 | pass→pass | 10,714 | 7,402 | -31% | 1 | 1 | 0% | 1,602 | 3,183 | +99% | 0 | 0 | — |
case-08 | pass→pass | 16,900 | 13,362 | -21% | 1 | 1 | 0% | 2,296 | 4,012 | +75% | 0 | 0 | — |
case-09 | pass→pass | 18,402 | 17,140 | -7% | 1 | 1 | 0% | 2,696 | 5,191 | +93% | 0 | 0 | — |
case-10 | pass→pass | 21,188 | 14,576 | -31% | 1 | 1 | 0% | 2,947 | 4,402 | +49% | 0 | 0 | — |
case-11 | pass→pass | 15,997 | 14,829 | -7% | 1 | 1 | 0% | 2,407 | 4,565 | +90% | 0 | 0 | — |
case-12 | pass→pass | 21,015 | 19,098 | -9% | 1 | 1 | 0% | 3,453 | 5,027 | +46% | 0 | 0 | — |
case-13 | pass→pass | 24,150 | 19,137 | -21% | 1 | 1 | 0% | 3,271 | 5,354 | +64% | 0 | 0 | — |
case-14 | pass→pass | 14,341 | 12,592 | -12% | 1 | 1 | 0% | 2,403 | 3,808 | +58% | 0 | 0 | — |
case-15 | fail→pass | 21,085 | 18,376 | -13% | 1 | 1 | 0% | 2,821 | 5,093 | +81% | 0 | 0 | — |
case-16 | pass→pass | 13,296 | 10,694 | -20% | 1 | 1 | 0% | 2,401 | 4,011 | +67% | 0 | 0 | — |
case-17 | pass→pass | 11,478 | 9,219 | -20% | 1 | 1 | 0% | 1,889 | 3,752 | +99% | 0 | 0 | — |
case-18 | pass→pass | 11,212 | 9,326 | -17% | 1 | 1 | 0% | 1,578 | 3,736 | +137% | 0 | 0 | — |
case-20 | pass→pass | 14,101 | 25,044 | +78% | 1 | 1 | 0% | 2,285 | 7,463 | +227% | 0 | 0 | — |
case-21 | fail→fail | 10,421 | 7,261 | -30% | 1 | 1 | 0% | 1,865 | 3,460 | +86% | 0 | 0 | — |
case-22 | pass→pass | 12,927 | 25,834 | +100% | 1 | 1 | 0% | 2,144 | 6,499 | +203% | 0 | 0 | — |
case-23 | pass→pass | 9,637 | 18,924 | +96% | 1 | 1 | 0% | 1,708 | 5,210 | +205% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.