Immediate Child selector in LESS

前端 未结 5 1025
天涯浪人
天涯浪人 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:06

    Also, If you are targeting the first child element, such as the first of a , you could use something like this:

    tr {
        & > td:first-child {font-weight:bold;}
    }
    

    this helps reduce class declarations when they aren't needed.

提交回复
热议问题