--- id: 5a9d726c424fe3d0e10cad11 title: Create a custom CSS Variable challengeType: 0 videoUrl: '' localeTitle: 创建自定义CSS变量 --- ## Description
要创建一个CSS变量,你只需要给它一个nametwo dashes在它前面,并为其分配一个value是这样的:
- penguin-skin:灰色;
这将创建一个名为--penguin-skin的变量,并为其赋值为gray 。现在,您可以在CSS中的其他位置使用该变量将其他元素的值更改为灰色。
## Instructions
penguin类中,创建一个变量名称--penguin-skin并赋予它一个gray
## Tests
```yml tests: - text: penguin类应声明--penguin-skin变量并将其指定为gray 。 testString: 'assert(code.match(/.penguin\s*?{[\s\S]*--penguin-skin\s*?:\s*?gray\s*?;[\s\S]*}/gi), "penguin class should declare the --penguin-skin variable and assign it to gray.");' ```
## Challenge Seed
```html
```
## Solution
```js // solution required ```