Class inheritance in scss example

Project: codever

Use the @extend directive. In this case the border style is inherited:

.last-search-border {
  border-width: 0.05rem;
  border-style: solid;
  border-color: #495057;
}

.public-bookmarks-last-search {
  @extend .last-search-border;
  background: #f0f2f5;
  color: black;
}

.my-bookmarks-last-search {
  @extend .last-search-border;
  background: linen;
  color: #495057;
}

Reference - https://sass-lang.com/documentation/at-rules/extend


Shared with from Codever. 👉 Use the Copy to mine functionality to copy this snippet to your own personal collection and easy manage your code snippets.

Codever is open source on Github ⭐🙏

Subscribe to our newsletter for more code resources and news

Adrian Matei (aka adixchen)

Adrian Matei (aka adixchen)
Life force expressing itself as a coding capable human being

routerLink with query params in Angular html template

routerLink with query params in Angular html template code snippet Continue reading