LoginSignup
0
0

More than 5 years have passed since last update.

Sass 入れ子で要素にもクラスを付ける

Last updated at Posted at 2019-01-14

どう説明していいか分からないですが。

.test {
    background-color: #fff;
}
p.test {
   background-color: #f00;
}

を Sass の入れ子でどう書くか

.test {
    background-color: #fff;

    @at-root {

        p#{&} {
            background-color: #f00;
        }
    }
}

で多分大丈夫かと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0