Merge pull request #15679 from Manish-Giri/fix/allow-shorthand-hex-values
Allow shorthand Hex values in challenge
This commit is contained in:
		| @@ -1587,7 +1587,8 @@ | ||||
|         "Example:", | ||||
|         "<code>background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));</code>", | ||||
|         "<hr>", | ||||
|         "Use a <code>linear-gradient()</code> for the <code>div</code> element's <code>background</code>, and set it from a direction of 35 degrees to change the color from <code>#CCFFFF</code> to <code>#FFCCCC</code>." | ||||
|         "Use a <code>linear-gradient()</code> for the <code>div</code> element's <code>background</code>, and set it from a direction of 35 degrees to change the color from <code>#CCFFFF</code> to <code>#FFCCCC</code>.", | ||||
|         "<strong>Note</strong><br>While there are other ways to specify a color value, like <code>rgb()</code> or <code>hsl()</code>, use hex values for this challenge." | ||||
|       ], | ||||
|       "challengeSeed": [ | ||||
|         "<style>", | ||||
| @@ -1596,7 +1597,7 @@ | ||||
|         "    border-radius: 20px;", | ||||
|         "    width: 70%;", | ||||
|         "    height: 400px;", | ||||
|         "    margin:  50 auto;", | ||||
|         "    margin: 50px auto;", | ||||
|         "    ", | ||||
|         "  }", | ||||
|         "", | ||||
| @@ -1605,7 +1606,7 @@ | ||||
|         "<div></div>" | ||||
|       ], | ||||
|       "tests": [ | ||||
|         "assert(code.match(/background:\\s*?linear-gradient\\(35deg,\\s*?#CCFFFF,\\s*?#FFCCCC\\);/gi), 'message: The <code>div</code> element should have a <code>linear-gradient</code> <code>background</code> with the specified direction and colors.');" | ||||
|         "assert(code.match(/background:\\s*?linear-gradient\\(35deg,\\s*?(#CCFFFF|#CFF),\\s*?(#FFCCCC|#FCC)\\);/gi), 'message: The <code>div</code> element should have a <code>linear-gradient</code> <code>background</code> with the specified direction and colors.');" | ||||
|       ], | ||||
|       "solutions": [], | ||||
|       "hints": [], | ||||
|   | ||||
		Reference in New Issue
	
	Block a user