--- id: 587d7dbd367417b2b2512bb4 title: Store Data with Sass Variables required: - src: 'https://cdnjs.cloudflare.com/ajax/libs/sass.js/0.10.9/sass.sync.min.js' raw: true challengeType: 0 --- ## Description
One feature of Sass that's different than CSS is it uses variables. They are declared and set to store data, similar to JavaScript. In JavaScript, variables are defined using the let and const keywords. In Sass, variables start with a $ followed by the variable name. Here are a couple examples:
$main-fonts: Arial, sans-serif;
$headings-color: green;

//To use variables:
h1 {
  font-family: $main-fonts;
  color: $headings-color;
}
One example where variables are useful is when a number of elements need to be the same color. If that color is changed, the only place to edit the code is the variable value.
## Instructions
Create a variable $text-color and set it to red. Then change the value of the color property for the .blog-post and h2 to the $text-color variable.
## Tests
```yml tests: - text: Your code should have a Sass variable declared for $text-color with a value of red. testString: assert(code.match(/\$text-color:\s*?red;/g), 'Your code should have a Sass variable declared for $text-color with a value of red.'); - text: Your code should use the $text-color variable to change the color for the .blog-post and h2 items. testString: assert(code.match(/color:\s*?\$text-color;/g), 'Your code should use the $text-color variable to change the color for the .blog-post and h2 items.'); - text: Your .blog-post element should have a color of red. testString: assert($('.blog-post').css('color') == 'rgb(255, 0, 0)', 'Your .blog-post element should have a color of red.'); - text: Your h2 elements should have a color of red. testString: assert($('h2').css('color') == 'rgb(255, 0, 0)', 'Your h2 elements should have a color of red.'); ```
## Challenge Seed
```html

Learn Sass

Some random title

This is a paragraph with some random text in it

Header #2

Here is some more random text.

Here is another header

Even more random text within a paragraph

```
## Solution
```js // solution required ```