0

I created a Magento Child Theme under 2.3.0 based on Luma.

I tested in Developer and Default Magento Mode. I expect the custom _theme.less file to be generated on the fly.

But this does not work. I have to run "php bin/magento setup:upgrade" after every single css line change to take the changes affected in front-end.

Also there is a Child Theme based Folder in pub/static folder. Why is this created? Im running default/developer mode so i don't expect the system to create any /pub/static/ files?

I already tried cache:flush and cache:clean.

It workes too when i change modes in magento from dev to production and visaversa.

New Info: I added a new .css File to the Theme and it works like expected. So i think the problem with the _theme.less is about the .less compiling is not working on the fly?

0

When you run php bin/magento setup:upgrade that will clear the cache for you as a part of the upgrade process, i think that is your issue here, as setup:upgrade has nothing to do with static file in the system.

Also, no matter what mode you are in, Magento will create a /pub/static/ section as this is where files that are served directly to the browser are stored (as opposed to php files that have additional processing done on the server side). So the site seems (from your description) to be working correctly.

When you make a change to you custom _theme.less file, if those changes are reflected in the child theme's CSS files in the pub/static folder, then you are good to go, caching is the issue with change not showing up in the browser.

  • thanks for the reply, i tried to clean magento cache with cache:flush and cache:clean. Then i cleaned my browsercache and tried a differents browser too but still nothing happens. Only setup:upgrade seems to work. Im really confused about this behavior. in /pub/static/frontend/Vendorname/luma_child/de_DE/css/styles-m.css i dont see the changes that i made to /app/design/frontend/Vendorname/luma_child/web/css/source/_theme.less – Rimmeh Jan 16 at 9:00
  • There are other ways to set up your styles to compile, so i'm not 100% sure about the path you are trying to take. I might then be wrong and setup:upgrade might be doing a deploy. A few questions, is there a reason you are in default mode? and when happened when you just do a php bin/magento setup:static-content:deploy -f? – circlesix Jan 16 at 19:03

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.