app/design/vendor/theme_name/Magento_Catalog/web/css/source/_module.less in file i have some changes in less file then compilation some error like some variable not define and i try replace file _module.less in to _extend.less file then no error in compilation
i try to add _moduele.less file then
Compilation from source: /var/www/html/magento2demo/vendor/magento/theme-frontend-blank/web/css/styles-m.less variable @product-name-link__color is undefined in file /var/www/html/magento2demo/var/view_preprocessed/pub/static/frontend/Cogent/Cogent_Theme/en_US/css/source/_extends.less in _extends.less on line 294, column 31 292| > a { 293| .lib-link( 294| @_link-color: @product-name-link__color, 295| @_link-text-decoration: @product-name-link__text-decoration enter image description here
i try _extend.less then work fineenter image description here
what is diifrence between _extend.less and _module.less and when i use ??/
CodePudding user response:
Diffrenec between _extend.less and _module.less files
_extend.less
we use _extend.less file when you want to use parent CSS and want add more CSS
_module.less
_module.less file is used to when we want to completely newly theme at that case we cannot use previous declare variable. we need to declare that variable again into theme variable file.
You can check more guide into following link Read more