--- id: 587d7dbd367417b2b2512bb4 title: Store Data with Sass Variables challengeType: 0 videoUrl: '' localeTitle: Almacenar datos con variables Sass --- ## Description
Una característica de Sass que es diferente de CSS es que utiliza variables. Se declaran y configuran para almacenar datos, de forma similar a JavaScript. En JavaScript, las variables se definen utilizando las palabras clave let y const . En Sass, las variables comienzan con $ seguido del nombre de la variable. Aqui hay un par de ejemplos:
$ main-fonts: Arial, sans-serif;
$ encabezados-color: verde;

// Para utilizar variables:
h1 {
familia de fuentes: $ main-fonts;
color: $ encabezados-color;
}
Un ejemplo en el que las variables son útiles es cuando varios elementos deben ser del mismo color. Si se cambia ese color, el único lugar para editar el código es el valor variable.
## Instructions
Crea una variable $text-color y configúrala en rojo. Luego cambie el valor de la propiedad de color para .blog-post y h2 a la variable $text-color .
## Tests
```yml tests: - text: Su código debe tener una variable Sass declarada para $text-color con un valor de rojo. 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: Su código debe usar la variable $text-color para cambiar el color de los elementos .blog-post y h2 . 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: Tu elemento .blog-post debe tener un color rojo. testString: 'assert($(".blog-post").css("color") == "rgb(255, 0, 0)", "Your .blog-post element should have a color of red.");' - text: Tus elementos h2 deben tener un color rojo. 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 ```