@Import of less files into a limited scope

前端 未结 3 1857
遇见更好的自我
遇见更好的自我 2021-02-02 10:53

I want to import all styles from another less file, but into a limited scope. I\'m trying this:

\"my-site.less\"

.wrapper-class {
    @import \"path/to/s         


        
3条回答
  •  猫巷女王i
    2021-02-02 11:34

    The syntax of LESS (and CSS) don't allow @imports into CSS rules. Try use namespace:

    styles.less

    .styles {
        [your code]
    }
    

    Then, replace the @import for namespace:

    .wrapper-class {
        .styles;
    }
    

    Reference:

    http://lesscss.org/features/

提交回复
热议问题