Sass change color of body eliment

I am using sass pre-compiler. Lets say we have this in html body


<h1 class="test"><h1>

sass:

@mixins test{

background-color: red;

}

xxxxx {

 @include test();

}

My question is this how can I put background color in the h1 tag with a class name of “test” do I put the class name also in the xxxx. ?

Did you test it?

But yes, you would use the selector for the element you want to use the mixin in. Also, it is mixin not mixins and you don’t need the parentheses unless you are passing arguments (docs).

@mixin color-danger {
  background-color: red;
}

.btn-danger {
  @include color-danger;
}