{ "$schema": "../schemas/code-crispies-module-schema.json", "id": "responsive-design", "title": "Responsive Design & Media Queries", "description": "Make your layouts adapt to different screen sizes using media queries and fluid design techniques.", "difficulty": "intermediate", "lessons": [ { "id": "responsive-1", "title": "Introduction to Media Queries", "description": "Understand the syntax and use cases for CSS media queries to apply styles conditionally based on viewport characteristics.", "task": "Write a media query that applies when the viewport is at most 600px wide and changes the background of '.responsive-box' to lightcoral.", "previewHTML": "
Fluid Typography
", "previewBaseCSS": "body { font-family: sans-serif; padding: 1rem; }", "sandboxCSS": "", "codePrefix": "/* Apply fluid font sizing */\n.fluid-text {", "initialCode": "", "codeSuffix": "}", "previewContainer": "preview-area", "validations": [ { "type": "contains", "value": "font-size", "message": "Use 'font-size' property", "options": { "caseSensitive": false } }, { "type": "contains", "value": "vw", "message": "Use 'vw' unit for fluid sizing", "options": { "caseSensitive": false } }, { "type": "property_value", "value": { "property": "font-size", "expected": "5vw" }, "message": "Set font-size to '5vw'" } ] }, { "id": "responsive-3", "title": "Flexible Grids", "description": "Combine CSS Grid with auto-fit or auto-fill for responsive column layouts.", "task": "Define '.grid-responsive' with grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); and a gap of 1rem.", "previewHTML": "