Reading list Switch to dark mode

    How to extend/override module’s style in theme Magento2

    Updated 23 May 2022

    In this guide we will learn how to extend/override our module’s style in our theme easily.
    To extend the module style in your theme directory, please follow below steps:
    1. Create a directory at path: app/design/frontend/<vendor_name>/<theme_name>/Module_name/web/css/source.
    2. Create an _extend.less file at the above path. For example, if you want to override the style for Magento_Catalog module, the directory path :
    Magento_Catalog -> web -> css-> source -> _extend.less
    3. Add Additional style in your recently created _extend.less file.

    To override the module style in your theme directory, please follow below steps:
    1. Create a directory at path: app/design/frontend/<vendor_name>/<theme_name>/Module_name/web/css/source.
    2. Create an _module.less file at the above path. For example, if you want to override the style for Magento_Catalog module, the directory path :
    Magento_Catalog -> web -> css-> source -> _module.less
    3. Add style in your recently created _module.less file.

    We hope it will help you. Thank you!!

    If any issue or doubt please feel free to mention in comment section.

    We would be happy to help. Happy Coding!!

    Start your headless eCommerce
    now.
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home