Jack Fagan
Jack Fagan

Reputation: 13

Using inheritance in scss to reference a class

I have these classes:

<form class="help-form">
    <h1 class = "form-title">Title</h1>
    <p class = "form-description">Description</p>
</form>

How can I reference both the form title and description in the same SCSS class but inside the help form to give them both font colour of white.

Upvotes: 1

Views: 49

Answers (1)

Stasiulek
Stasiulek

Reputation: 26

Jack, You can nest selectors and use , to target multiple selectors. Hope this helps!

.help-form {
  .form-title, .form-description {
    color: white;
  }
}

Upvotes: 1

Related Questions