John Hoge
John Hoge

Reputation: 2391

Add Margin to using Sass mixins in bootstrap

I have a page that has a bunch of Section tags in it and I have a my-5 class on each one. Rather than repeating that every time I'd love to see if I could use a Sass Mixin to apply the my-5 css automatically to the Section tag so I could simply turn this

<section class="my-5">

into this

<section>

Upvotes: 0

Views: 153

Answers (1)

Carol Skelly
Carol Skelly

Reputation: 362440

You would use SASS @extend inside the section rule...

section {
   @extend .my-5;
}

https://www.codeply.com/go/6ziZAFqFJj

Upvotes: 2

Related Questions