0

I had been trying to set up a theme in Magento 2 several weeks ago and now when I try to continue the work, it seems that the CSS on the site has stopped working for my theme. The site loads without any CSS at all.

I have tried to clear the cache (and CSS merged cache) but it is still not working.

As I am still trying to get LESS figured out, I am wondering whether it might be some css I have changed which causes LESS to crash. Is there any way to determine if LESS is not working or what else the issue might be?

  • just to get some more info, what mode are you set in stores->config->advanced->developer->Frontend Development Workflow . This will determine if you are having magento compile the less files when you reload the page using js, or if magento is using the built in php compiler. Next, what is in your pub/static/frontend folder path? when you dig down to your theme, you should find all the front end assets. This is where the browser will look to load the css files. What kind of theme set up are you using? And finally do you have grunt installed and working on your site? – circlesix Apr 27 '17 at 22:06
0

It should work as previous. Cant tell you exactly whats the issue. But the below worth a try.

1) Remove pub/static/frontend (for frontend) and pub/static/adminhtml (only for admin side).
2) Remove var/cache and var/view_preprocessed.
3) php bin/magento setup:static-content:deploy (for production).

Refresh the browser and check now.

  • Kingshuk - thank you for taking the time to reply. I have tried all of your steps and the CSS is still not showing. None of the magento css is showing at all - only pure HTML. Is there any way to tell if I had broke the LESS (like deleted a variable or the like)? – JWeiss Apr 27 '17 at 20:44
0

You Should look for merging CSS and JavaScript files in magento admin panel,

Navigate to System->Configuration->Advance(Developer)->javaScript Settings and CSS Settings And select 'no' on both options.

You can consider Turning off flat tables and category for a while to ensure the cause.

Clear the cache through admin panel as well as var/cache folder.

  • Lalit838 - thank you for replying. All of the merging is set to "No" and the cache has been cleared but not a single bit of CSS is showing - only HTML. The CSS shows with the default and Luma themes but not with mine. Is there any way to determine where the error might be? – JWeiss Apr 27 '17 at 20:47
  • What do you see in Page view, press ctrl+U on the webpage to see page view. and let me know what you got. – Lalit838 Apr 28 '17 at 6:55

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.