【CSS】上書きを回避する方法
:not を使用してCSSの上書きを回避する。
// bad .item-item { margin-bottom: 20px; &:last-child { margin-bottom: 0; } }
// good .list-item { &:not(:last-child) { margin-bottom: 20px; } }
// bad .item-item { margin-bottom: 20px; &:last-child { margin-bottom: 0; } }
// good .list-item { &:not(:last-child) { margin-bottom: 20px; } }