feat: add CSS Grid and Flexbox lessons with updated styles and tasks
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
"description": "Selectors are patterns used to select HTML elements you want to style. In this lesson, you'll learn how to target elements with CSS.",
|
||||
"task": "Style the paragraph element by making its text color blue. Use the 'color' property with the value 'blue'.",
|
||||
"previewHTML": "<p class='target'>This paragraph needs to be blue!</p><p>This paragraph should remain unchanged.</p>",
|
||||
"previewBaseCSS": "body { font-family: sans-serif; padding: 20px; }",
|
||||
"sandboxCSS": ".target { outline: 2px dashed #ccc; padding: 10px; }",
|
||||
"previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; }",
|
||||
"sandboxCSS": ".target { outline: 0.125rem dashed #ccc; padding: 0.625rem; }",
|
||||
"codePrefix": "/* Style the paragraph with class 'target' */\n",
|
||||
"initialCode": "",
|
||||
"codeSuffix": "",
|
||||
@@ -50,9 +50,9 @@
|
||||
"id": "basics-2",
|
||||
"title": "Box Model Basics",
|
||||
"description": "The CSS box model is a fundamental concept that describes how elements are sized and spaced on a page.",
|
||||
"task": "Add padding of 20px and a 2px solid border with color #333 to the box element.",
|
||||
"task": "Add padding of 1.25rem and a 0.125rem solid border with color #333 to the box element.",
|
||||
"previewHTML": "<div class='box'>This box needs padding and a border!</div>",
|
||||
"previewBaseCSS": "body { font-family: sans-serif; padding: 20px; } .box { background-color: #f0f0f0; }",
|
||||
"previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; } .box { background-color: #f0f0f0; }",
|
||||
"sandboxCSS": "",
|
||||
"codePrefix": "/* Add padding and border to the box */\n.box {\n /* Add your code below */\n",
|
||||
"initialCode": "",
|
||||
@@ -79,17 +79,17 @@
|
||||
"type": "property_value",
|
||||
"value": {
|
||||
"property": "padding",
|
||||
"expected": "20px"
|
||||
"expected": "1.25rem"
|
||||
},
|
||||
"message": "Set the padding to '20px'",
|
||||
"message": "Set the padding to '1.25rem'",
|
||||
"options": {
|
||||
"exact": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"value": "border:\\s*2px\\s+solid\\s+#333",
|
||||
"message": "Set the border to '2px solid #333'",
|
||||
"value": "border:\\s*0.125rem\\s+solid\\s+#333",
|
||||
"message": "Set the border to '0.125rem solid #333'",
|
||||
"options": {
|
||||
"caseSensitive": false
|
||||
}
|
||||
@@ -102,7 +102,7 @@
|
||||
"description": "Learn how to apply background colors and control text coloring in different ways.",
|
||||
"task": "Style the element with a background color of #e0f7fa and text color of #01579b.",
|
||||
"previewHTML": "<div class='colorbox'>This element needs colors!</div>",
|
||||
"previewBaseCSS": "body { font-family: sans-serif; padding: 20px; } .colorbox { padding: 25px; text-align: center; font-weight: bold; font-size: 18px; }",
|
||||
"previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; } .colorbox { padding: 1.5rem; text-align: center; font-weight: bold; font-size: 1.125rem; }",
|
||||
"sandboxCSS": "",
|
||||
"codePrefix": "/* Style the colorbox with background and text colors */\n",
|
||||
"initialCode": "",
|
||||
@@ -161,10 +161,10 @@
|
||||
"id": "basics-4",
|
||||
"title": "Typography Basics",
|
||||
"description": "Learn how to control text appearance with CSS typography properties.",
|
||||
"task": "Style the heading with font-family 'Georgia, serif', font-size of 24px, and add text-shadow of 1px 1px 2px #aaa.",
|
||||
"task": "Style the heading with font-family 'Georgia, serif', font-size of 1.5rem, and add text-shadow of 0.0625rem 0.0625rem 0.125rem #aaa.",
|
||||
"previewHTML": "<h2 class='heading'>Style This Heading Text</h2>",
|
||||
"previewBaseCSS": "body { font-family: sans-serif; padding: 20px; }",
|
||||
"sandboxCSS": ".heading { border-bottom: 1px solid #ddd; padding-bottom: 10px; }",
|
||||
"previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; }",
|
||||
"sandboxCSS": ".heading { border-bottom: 0.0625rem solid #ddd; padding-bottom: 0.625rem; }",
|
||||
"codePrefix": "/* Style the heading text */\n",
|
||||
"initialCode": "",
|
||||
"codeSuffix": "",
|
||||
@@ -204,8 +204,8 @@
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"value": "text-shadow:\\s*1px\\s+1px\\s+2px\\s+#aaa",
|
||||
"message": "Set the text-shadow to '1px 1px 2px #aaa'",
|
||||
"value": "text-shadow:\\s*0.0625rem\\s+0.0625rem\\s+0.125rem\\s+#aaa",
|
||||
"message": "Set the text-shadow to '0.0625rem 0.0625rem 0.125rem #aaa'",
|
||||
"options": {
|
||||
"caseSensitive": false
|
||||
}
|
||||
@@ -214,13 +214,13 @@
|
||||
},
|
||||
{
|
||||
"id": "basics-5",
|
||||
"title": "CSS Units",
|
||||
"description": "Learn about different CSS units like pixels, percentages, em, rem, and when to use each.",
|
||||
"task": "Set the width of the box to 80%, the max-width to 600px, and the font-size to 1.2rem.",
|
||||
"previewHTML": "<div class='units-box'>This box needs sizing with different units.</div>",
|
||||
"previewBaseCSS": "body { font-family: sans-serif; padding: 20px; } .units-box { background-color: #f5f5f5; padding: 15px; border: 1px solid #ddd; }",
|
||||
"title": "CSS Units and Variables",
|
||||
"description": "Learn about different CSS units like rem, percentages, em, and how to use CSS variables (custom properties).",
|
||||
"task": "Set the width of the box to 80%, the max-width to 37.5rem, and create a CSS variable --main-color with the value #6200ee, then use it for the border color.",
|
||||
"previewHTML": "<div class='units-box'>This box needs sizing with different units and a border using a CSS variable.</div>",
|
||||
"previewBaseCSS": "body { font-family: system-ui, -apple-system, sans-serif; padding: 1.25rem; } .units-box { background-color: #f5f5f5; padding: 1rem; border: 0.125rem solid #ddd; }",
|
||||
"sandboxCSS": "",
|
||||
"codePrefix": "/* Style the box using different units */\n",
|
||||
"codePrefix": "/* Style the box using different units and CSS variables */\n:root {\n /* Define your CSS variable here */\n}\n\n",
|
||||
"initialCode": "",
|
||||
"codeSuffix": "",
|
||||
"previewContainer": "preview-area",
|
||||
@@ -251,8 +251,16 @@
|
||||
},
|
||||
{
|
||||
"type": "contains",
|
||||
"value": "font-size",
|
||||
"message": "Use the 'font-size' property",
|
||||
"value": "--main-color",
|
||||
"message": "Define the '--main-color' CSS variable",
|
||||
"options": {
|
||||
"caseSensitive": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "contains",
|
||||
"value": "var(--main-color)",
|
||||
"message": "Use the CSS variable with var(--main-color)",
|
||||
"options": {
|
||||
"caseSensitive": false
|
||||
}
|
||||
@@ -272,20 +280,9 @@
|
||||
"type": "property_value",
|
||||
"value": {
|
||||
"property": "max-width",
|
||||
"expected": "600px"
|
||||
"expected": "37.5rem"
|
||||
},
|
||||
"message": "Set the max-width to '600px'",
|
||||
"options": {
|
||||
"exact": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "property_value",
|
||||
"value": {
|
||||
"property": "font-size",
|
||||
"expected": "1.2rem"
|
||||
},
|
||||
"message": "Set the font-size to '1.2rem'",
|
||||
"message": "Set the max-width to '37.5rem'",
|
||||
"options": {
|
||||
"exact": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user