“无法识别输入”错误,LESS保护mixin [英] `Unrecognized input` error with LESS guarded mixin

查看:453
本文介绍了“无法识别输入”错误,LESS保护mixin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的LESS项目中,我遇到的问题是让我的看守mixins处理我在另一个文件中声明的变量。以下是我正在使用的代码:



_defaults.less (包含我的所有变量) < br $> b $ b

In my LESS project I am having issues getting my guarded mixins working with variables that I declared in another file. Here is the code I am working with:

_defaults.less (contains all of my variables)

//------------------------------------//
//  @INCLUDE
//------------------------------------//
// Set whatever components you want included
// in your project to `true` and any components
// you do not wish to be included to `false`

// Base
@use-main:        true;





_main.less (在我的项目中只是一个随机的部分)





_main.less (just a random partial in my project)

.main(@boolean) when (@boolean = true) {
    // Styles go here
}

// Execute mixin
.main(@use-main);





style.less (导入我所有的部分)





style.less (imports all of my partials)

//------------------------------------//
//  @IMPORTS
//------------------------------------//

// Base styles
@import "base/_main.less";





这就是我的项目结构(大约20个部分,然后导入到`style) .less`文件)



每当我尝试编译项目时,都会收到此错误:





This is how my project is structured (for around 20 partials that are then imported into the `style.less` file).

Whenever I try to compile my project, I get this error:

> Unrecognised input
> c:\Users\Keenan\Documents\GitHub\project\less\base\_main.less line 1

推荐答案

这篇关于“无法识别输入”错误,LESS保护mixin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆