How do i get the same object with a class in SCSS?

后端 未结 1 1432
予麋鹿
予麋鹿 2020-12-22 06:42

I have this code:

input[type=\"text\"] {
    color: red;
    .blue {
        color: blue;
    }
}

That gives me this

input[         


        
相关标签:
1条回答
  • 2020-12-22 06:58

    You're looking for the parent selector (&):

    input[type="text"] {
        color: red;
        &.blue {
            color: blue;
        }
    }
    
    0 讨论(0)
提交回复
热议问题