--- id: 5a9d727a424fe3d0e10cad12 title: Use a custom CSS Variable challengeType: 0 videoUrl: 'https://scrimba.com/c/cM989ck' forumTopicId: 301090 dashedName: use-a-custom-css-variable --- # --description-- After you create your variable, you can assign its value to other CSS properties by referencing the name you gave it. ```css background: var(--penguin-skin); ``` This will change the background of whatever element you are targeting to gray because that is the value of the `--penguin-skin` variable. Note that styles will not be applied unless the variable names are an exact match. # --instructions-- Apply the `--penguin-skin` variable to the `background` property of the `penguin-top`, `penguin-bottom`, `right-hand` and `left-hand` classes. # --hints-- The `--penguin-skin` variable should be applied to the `background` property of the `penguin-top` class. ```js assert( code.match( /.penguin-top\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.penguin-bottom\s{/gi ) ); ``` The `--penguin-skin` variable should be applied to the `background` property of the `penguin-bottom` class. ```js assert( code.match( /.penguin-bottom\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.right-hand\s{/gi ) ); ``` The `--penguin-skin` variable should be applied to the `background` property of the `right-hand` class. ```js assert( code.match( /.right-hand\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}[\s\S]*.left-hand\s{/gi ) ); ``` The `--penguin-skin` variable should be applied to the `background` property of the `left-hand` class. ```js assert( code.match( /.left-hand\s*?{[\s\S]*background\s*?:\s*?var\s*?\(\s*?--penguin-skin\s*?\)\s*?;[\s\S]*}/gi ) ); ``` # --seed-- ## --seed-contents-- ```html
``` # --solutions-- ```html ```