0

I'm trying to understand exactly how / when LESS files get compiled and unfortunately I'm not much further than what I started.

I tried installing grunt, but I'm having all kinds of permission problems...but that's kind of a separate issue. Even if I have to run all the commands necessary manually that's ok, even though it's kind of inefficient.

From all the documentation I've read, it seems like the following should compile LESS but it doesn't seem to be working:

  1. Clear out pub/static, var/view_preprocessed, var/generation

  2. Creating symlinks to LESS files using bin/magento dev:source-theme:deploy --type=less --locale=en_US --area=frontend --theme=MyVendor/mytheme

  3. Deploying static view files using bin/magento setup:static-content:deploy I think that should be it, but maybe I'm missing something. Doing the above does not get the _custom.less file I created compiled into the correct file (styles-m.css in this case).

The only way I can get it to work, is to change the mode from developer to production w/ compilation on (which errors, but again separate issue).

Something in the compilation process is getting the CSS from my LESS file and compiling it, but that seems to be the only thing that works.

I have a decent amount of experience w/ Magento 1.9 and below and I'm getting to the point where I might do the project using that vs. Magento 2.1. I've already lost a lot of time just trying to figure out how to make simple CSS changes.

Any help would be greatly appreciated.

0

Grunt is the best way to process your less files. The permissions issues that you have is the main reason why Grunt will not work properly. You need to resolve those issues by giving permission to those said files or just easily sudo your commands on a terminal(mac/linux) or have admin privileges on command line(windows). But i do think the permission errors are a result of incorrect installation of your Magento 2 in the first place.

Do try to trace the issue of the permission errors before doing your option 2 which is doing the work on magento 1.9. Magento 1.9 will sooner or later be obsolete it's time for you to learn Magento 2.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.