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

前端 未结 10 2003
清歌不尽
清歌不尽 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:22

    I think it is because of which master less file you are compiling. Likewise

    If you have Less/Project_name/project.less and in this project.less you import the variable less and all the other files which has in the directory.

    You just have to compile project.less into your css, not all less files. If you try to compile project.less and variables.less at a time you will have this error. And you can avoid redundant declaration of importing the variable less files

提交回复
热议问题