クラスが同じ CSS 属性を共有する場合、以前は SASS がなくても、以下のように簡単にグループ化できました。
.header, .content, .footer {
height:100%;
}
しかし、SASS/SCSS などを使用すると、スタイルの管理が非常に簡単になります。したがって、質問には、以下のミックスインを考慮した CSS パフォーマンスの考慮事項が与えられます
@mixin sameHeight{
height:100%;
}
実装は
.content {
@include sameHeight;
}
.footer {
@include sameHeight;
}
.header {
@include sameHeight;
}
/* CSS OUTPUT */
.header {
height:100%;
}
.content{
height:100%;
}
.footer{
height:100%;
}
それともそうあるべきか
.header, .content, .footer {
@include sameHeight;
}
/* CSS OUTPUT */
.header, .content, .footer {
height:100%;
}