LESS mixin 仅在同一样式表中声明时才起作用
我对某些事情有点困惑:
我决定制作一个全局 LESS 文档,在其中声明我的 mixin。当在其他样式表中引用 mixin 时,它们不起作用。它们似乎只有在同一样式表中声明和引用时才起作用。这真的很烦人。 LESS 就是这样工作的吗?
谢谢!
巴斯坦
I'm a little confused about something:
I decided to make a global LESS document where I declare my mixins. When the mixins are referenced in other style sheets, they do not work. They only seem to work when they are declared and referenced in the same style sheet. This is really annoying. Is this how LESS is suppose to work?
Thanks!
Bastain
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
LESS 使用类似于 C 和 C++ 所使用的导入样式。您需要使用
@import
命令将 mixin 样式表导入到 LESS 文件中,然后才能使用这些 mixin。LESS uses an import style that is similar to that used by C and C++. You need to import your mixin stylesheet into your LESS file using the
@import
command before you can use those mixins.