sass-site/source/code-snippets/_homepage-extend-scss.md

34 lines
502 B
Markdown
Raw Normal View History

2013-02-24 07:04:16 +01:00
```scss
// This CSS won't print because %equal-heights is never extended.
%equal-heights {
display: flex;
flex-wrap: wrap;
}
// This CSS will print because %message-shared is extended.
%message-shared {
border: 1px solid #ccc;
2013-02-24 07:04:16 +01:00
padding: 10px;
color: #333;
}
.message {
@extend %message-shared;
}
2013-02-24 07:04:16 +01:00
.success {
@extend %message-shared;
2013-02-24 07:04:16 +01:00
border-color: green;
}
.error {
@extend %message-shared;
2013-02-24 07:04:16 +01:00
border-color: red;
}
.warning {
@extend %message-shared;
2013-02-24 07:04:16 +01:00
border-color: yellow;
}
```