Merge pull request #15679 from Manish-Giri/fix/allow-shorthand-hex-values

Allow shorthand Hex values in challenge
pull/15744/head
Dylan 2017-08-01 10:09:06 -05:00 committed by GitHub
commit b5f4924e6b
1 changed files with 4 additions and 3 deletions

View File

@ -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": [],