简体   繁体   中英

Meteor Less package not working

I have a Meteor project and I'm trying to use my .less files to make some styles. Well, I installed less package from Atmosphere ( https://atmospherejs.com/meteor/less ) and did what usage says.

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:

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


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

So, my sb-admin-2.import.less file is like:

@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. Tried to put some absolute way, like: @import "./admin/styles/sb-admin-2.import.less"; and still dont work.

Anyone have a light for my case? What I'm doing wrong in the *.import.less files imports?

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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