简体   繁体   English

Meteor Less包不起作用

[英]Meteor Less package not working

I have a Meteor project and I'm trying to use my .less files to make some styles. 我有一个Meteor项目,我正在尝试使用我的.less文件来制作一些样式。 Well, I installed less package from Atmosphere ( https://atmospherejs.com/meteor/less ) and did what usage says. 好吧,我从Atmosphere安装了更少的软件包( https://atmospherejs.com/meteor/less )并按照用法说的做了。

My directory tree is like: 我的目录树如下:

AppFolder
    - admin
    -- client
    -- lib
    -- server
    -- styles
    --- admin.less
    --- sb-admin-2.import.less
    --- sb-mixins.import.less
    --- sb-variables.import.less
    -- views
    - lib
    - public
    - scripts
    - styles

My admin.less file is like: 我的admin.less文件就像:

@import "sb-admin-2.import.less";


html,body {}
...
(some less code)

So, my sb-admin-2.import.less file is like: 所以,我的sb-admin-2.import.less文件就像:

@import "sb-variables.import.less";
@import "sb-mixins.import.less";

// Global Styles
(more less code)

But, this is not compiling and showing on my project as loaded. 但是,这并没有编译并在我的项目中显示为已加载。 No styles from this files appears to be used in project. 此文件中没有样式似乎在项目中使用。

Someone knows what is happening and can help me? 有人知道发生了什么,可以帮助我吗?

Edit: 编辑:

I discover that only the *.import.less files arent loaded. 我发现只加载* .import.less文件。 Tried to put some absolute way, like: @import "./admin/styles/sb-admin-2.import.less"; 试图采取一些绝对的方式,如:@import“./admin / styles / sb-admin-.import .less”; and still dont work. 仍然不工作

Anyone have a light for my case? 有人对我的案子有所了解吗? What I'm doing wrong in the *.import.less files imports? 在* .import.less文件导入中我做错了什么?

Thanks since now 谢谢你们

I'm a little confused by your app structure. 我对您的应用结构感到有点困惑。 I would have client, server, lib at the root level of your application. 我会在你的应用程序的根级别有客户端,服务器,lib。 Styles should be available to the client and therefor should be in the client folder like so. 样式应该可供客户端使用,因此应该在客户端文件夹中。

AppFolder
-- client
---- scripts
---- styles
------ admin.less
------ sb-admin-2.import.less
------ sb-mixins.import.less
------ sb-variables.import.less
---- views
-- lib
-- server
-- public

If you want to have pages just for admins, have an admin folder in your client structure and route accordingly. 如果您只想为管理员设置页面,请在客户端结构中设置一个管理员文件夹并进行相应的路由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM