混合使用LESS [英] Mixin using LESS

查看:132
本文介绍了混合使用LESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读LESS官方文档(版本1.5),但我不明白如何导入一个引用到另一个CSS,以使用其内容在我自己的文件。例如:

I'm reading the LESS official documentation (version 1.5) but I cannot understand how to import a reference to another CSS in order to use its content in my own file. For example:

mystyle.less

mystyle.less

@import (reference) "bootstrap.min.css";
.mylabel {
    .label-success;
}

显示此错误: NameError:.label-成功未定义

也许我误解了文档?

推荐答案

您只能对其他LESS文件使用引用。您不能混合和匹配LESS和CSS文件与该方法。

You can only use reference with other LESS files. You cannot mix and match LESS and CSS files with that method.

如果您需要使用Bootstrap中的mixins,请抓取Bootstrap LESS文件。

If you need to use the mixins from Bootstrap, grab the Bootstrap LESS files.

@import (reference, less) "bootstrap.min.css";

这篇关于混合使用LESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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