Variable Name Error “is undefined” even though “variables.less” imported

前端 未结 10 2024
清歌不尽
清歌不尽 2020-12-08 18:41

I started using LESS today. But it\'s kinda weird. This code does not work. I get an error:

! Variable Name Error: @linkColor in a is undefined.
10条回答
  •  一个人的身影
    2020-12-08 19:06

    You can also get this error if you are trying to import the file twice (not a good idea) and the first import is before your variables referenced in your.less file have been loaded

    Note: I'm using django compress

    in index.html i had:

    {% compress css %}
    
    
    {% endcompress %}
    

    then in styles.less i had

    ...
    @import "timepick.less";
    

提交回复
热议问题