0

I have created a custom theme, for the listing page i have created custom less file,

app\design\frontend\Zero\my_theme\Magento_Catalog\web\css\source\ _custom_listing_page.less

On the Website listing page my _custom_listing_page.less not working. which means not compiled into CSS file.

I have declared my _custom_listing_page.less in app\design\frontend\Zero\sleepworld\my_theme\layout\catalog_category_view.xml

   <head>        
   <css src="Magento_Catalog::css/source/_custom_listing_page.css" rel="stylesheet" type="text/css" />
   </head>

Console error - CSS file : canceled

enter image description here

Note : Local working good, when i move to live then i am getting the error.

1

1 Answer 1

0

Your catalog_category_view.xml should be something like this;

<head>        
   <css src="Magento_Catalog::css/custom_listing_page.css" rel="stylesheet" type="text/css" />
</head>
3
  • But i created with underscore right "_custom_listing_page.less", should i remove in xml file?
    – zus
    Feb 13, 2021 at 13:51
  • Its better to rename the custom less file without underscore. Because _ means these files will be used main wrapper less file and imported in. Feb 13, 2021 at 14:03
  • Understood your point, let me remove that, before i will ask one query, in localhost everything good, less compiled to css everything good, when i move to the live server there i am getting an error, any specific reason for this.
    – zus
    Feb 13, 2021 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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