Immediate Child selector in LESS

前端 未结 5 1026
天涯浪人
天涯浪人 2020-12-05 03:48

Is there anyway to have LESS apply the immediate child selector ( > ) in its output?

In my style.less, I want to write something like:

.panel {
    .         


        
5条回答
  •  伪装坚强ぢ
    2020-12-05 04:05

    The official way:

    .panel {
      & > .control {
        ...
      }
    }
    

    & always refers to the current selector.

    See http://lesscss.org/features/#features-overview-feature-nested-rules

提交回复
热议问题