SASS - Store Data with Sass Variables

Tell us what’s happening:
Describe your issue in detail here.
i cant pass the 1st and 2nd stages, i dont know what to do

  **Your code so far**
<style type='text/scss'>
.h2{color: red;}

.header{
  text-align: center;
}
.blog-post, h2 {
  color: red;
}
</style>

<h1 class="header">Learn Sass</h1>
<div class="blog-post">
<h2>Some random title</h2>
<p>This is a paragraph with some random text in it</p>
</div>
<div class="blog-post">
<h2>Header #2</h2>
<p>Here is some more random text.</p>
</div>
<div class="blog-post">
<h2>Here is another header</h2>
<p>Even more random text within a paragraph</p>
</div>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: SASS - Store Data with Sass Variables

Link to the challenge:

You skipped this step:

Create a variable $text-color and set it to red.

You pass the last two, but you do it the wrong way. Yes, you can get the finish line of the marathon on your scooter, but that wasn’t what you were supposed to do.

Look in the example with the variable $main-fonts, how it is created and used. Then apply that with $text-color.

honestly, ive been on this, i dont know how to go abt it

Please show the current state of your code and let us know what is confusing.

style type='text/scss'>
$text-color

  .header{
    text-align: center;
  }
  .blog-post, h2 {
    color: red;
  }
</style>

OK, this:

style type='text/scss'>

needs a < at the beginning, maybe that got lost in the cut and paste.

You have this to define your variable:

$text-color

but you need to say what it is. In the example, you have:

$headings-color: green;

You need to do something like that for your new variable, but with the correct variable name (which you have) but then give it a value (which you aren’t doing).

Then lastly, you need to use that new variable. You have this:

    color: red;

but instead of specifying the color specifically as “red”, you need to use your new variable. In the example, you have:

  color: $headings-color;

You need to do something like that, but with your new variable.

When I fix those things, your code passes for me.

1 Like