Sass mixins

PHOTO EMBED

Tue Mar 14 2023 21:19:27 GMT+0000 (Coordinated Universal Time)

Saved by @zaccamp

@mixin theme($theme: DarkGray) {
  background: $theme;
  box-shadow: 0 0 1px rgba($theme, .25);
  color: #fff;
}

.info {
  @include theme;
}
.alert {
  @include theme($theme: DarkRed);
}
.success {
  @include theme($theme: DarkGreen);
}


content_copyCOPY

A mixin lets you make groups of CSS declarations that you want to reuse throughout your site.

https://sass-lang.com/guide