LESS: Extend a previously defined nested selector

前端 未结 4 867
臣服心动
臣服心动 2020-12-20 19:27

I\'ve been trying like a mad man to get the following LESS statement to work, but now i am fearing that it\'s not gonna happen :/ So I am turning now to you guys in the end

4条回答
  •  梦毁少年i
    2020-12-20 19:42

    This is obviously something that should be working in LESS. I have a few months ago put an issue on the LESS.js github regarding exactly this.

    Link to Github issue

    In the mean time, i recommend using seven-phases-max's solution by simply putting the classes together like so:

    &-first, &-second {}
    

    But then you cant abstract the second out into another file.

    Another solution would to make an "extends.less" file, in which you can have small snippets you find your self using time from time.

提交回复
热议问题