How to style modules using recommended practice


Can you please let me know what is the correct way of styling a module look and feel on the front end?

i.e. I have a module from amasty.
From my understaning I need to modify ccs entries in _module.less file which sits on my server under:


When I change the file, clear cache, remove pub/static/* and var/view_prepocessed/* my changes are nicely shown on the front end but I’m guessing when I update the module all my changes will be overwritten. That is why I should never customize anything in the vendor directory.

I tried to move the _module.less file and modify it there but there are no changes on the front end.


Could you please give me a tip on how to do it correctly?
Thank you.

Yes, your current solution would be classed as editing “core code”.

Format Example

Now, if memory serves, you’re close with your solution. I think you actually need to put your _module.less file under:


Real Example

In the following example, it assumes you’re using:

  • Smartwave Porto Theme ("Smartwave")
  • Porto Child Theme ("porto_child")
  • Amasty Module called “Example” ("Amasty_Example")

*All care-sensitive


Side Note

I believe another way of doing it is to create a module in app/code/ and do something similar. But I don’t think I’ve done it that way before - So, I can’t talk you though it.

Neither of these two worked for me.

I tried 2 ways under /frontend
…and one creating a module

Annoying. I believe I will have to live with it and every time I upgrade the module I will have to update the file.

I’ll edit my answer over the weekend once I try it myself. I don’t think I’m far off the answer.

Thank you for your time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.