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 ⭐🙏