{ "$schema": "../schemas/code-crispies-module-schema.json", "id": "units-variables", "title": "Units, var() and calc()", "description": "Understand the variety of CSS measurement units and how to define and use custom properties for maintainable styles.", "difficulty": "beginner", "lessons": [ { "id": "units-1", "title": "Absolute vs. Relative Units", "description": "Learn the difference between px, rem, em, %, and vw/vh for flexible, responsive layouts.", "task": "Set the width of '.unit-box' to 80% and max-width to 37.5rem.", "previewHTML": "
--main-color variable in :root with #6200ee and apply it as the border color on '.var-box'.",
"previewHTML": "calc() function to combine different units in one expression.",
"task": "Set the width of '.calc-box' to calc(100% - 2rem) and min-height to calc(10vh + 1rem).",
"previewHTML": "