{
"$schema": "../schemas/code-crispies-module-schema.json",
"id": "typography-fonts",
"title": "Typography",
"description": "Learn how to control text appearance through font selection, sizing, spacing, and decorative effects.",
"difficulty": "beginner",
"lessons": [
{
"id": "typography-1",
"title": "Font Family & Fallbacks",
"description": "Specify custom fonts and reliable fallback stacks for consistent typography across devices.",
"task": "Set the font-family of the '.text' element to 'Georgia, serif' with serif fallback.",
"previewHTML": "
This text shows the chosen font family.
", "previewBaseCSS": "body { padding: 1rem; }", "sandboxCSS": "", "codePrefix": ".text {\n ", "initialCode": "", "codeSuffix": "\n}", "previewContainer": "preview-area", "solution": "font-family: Georgia, serif;", "validations": [ { "type": "contains", "value": "font-family", "message": "Use the font-family property", "options": { "caseSensitive": false } }, { "type": "regex", "value": "Georgia, serif", "message": "Include Georgia, serif in the font stack", "options": { "caseSensitive": false } } ] }, { "id": "typography-2", "title": "Font Size & Line Height", "description": "Control text scale and readability by adjusting size and line heights.", "task": "Set the heading '.heading' to 1.5rem font-size and 1.5 line-height.", "previewHTML": "font-style and font-weight.",
"previewHTML": "This text should stand out.
", "previewBaseCSS": "body { padding: 1rem; }", "sandboxCSS": "", "codePrefix": ".emphasis {\n ", "initialCode": "", "codeSuffix": "\n}", "previewContainer": "preview-area", "solution": "font-style: italic;\n font-weight: bold;", "validations": [ { "type": "contains", "value": "font-style", "message": "Use font-style property", "options": { "caseSensitive": false } }, { "type": "property_value", "value": { "property": "font-style", "expected": "italic" }, "message": "Set font-style to italic" }, { "type": "contains", "value": "font-weight", "message": "Use font-weight property", "options": { "caseSensitive": false } }, { "type": "property_value", "value": { "property": "font-weight", "expected": "bold" }, "message": "Set font-weight to bold" } ] }, { "id": "typography-4", "title": "Text Decoration & Shadow", "description": "Add decorative underlines, overlines, line-throughs and subtle shadows to text.", "task": "Apply an underline withtext-decoration and a light shadow using text-shadow on '.fancy'.",
"previewHTML": "Fancy text effect!
", "previewBaseCSS": "body { padding: 1rem; } .fancy { font-size: 1.25rem; }", "sandboxCSS": "", "codePrefix": ".fancy {\n ", "initialCode": "", "codeSuffix": "\n}", "previewContainer": "preview-area", "solution": "text-decoration: underline;\n text-shadow: 1px 1px 2px gray;", "validations": [ { "type": "contains", "value": "text-decoration", "message": "Use text-decoration property", "options": { "caseSensitive": false } }, { "type": "contains", "value": "text-shadow", "message": "Use text-shadow property", "options": { "caseSensitive": false } } ] } ] }