親セレクターの参照
親セレクターの参照をするには、&
を使用します。
構文
&セレクター {
...
}
サンプルコード
SCSS
a { font-size : 12px ; text-decoration : none ; &:hover { color : #d00 ; text-decoration : underline ; } } |
コンパイル後:CSS
a { font-size : 12px ; text-decoration : none ; } a:hover { color : #d00 ; text-decoration : underline ; } |