Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 948
Augusto TMW Avatar asked Jun 26 '26 00:06

Augusto TMW


1 Answers

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.

like image 82
Nate Avatar answered Jun 27 '26 14:06

Nate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!