5

I created custom theme based on luma theme.

And my theme contain only 2 files theme.xml registration.php file.

And i configured this theme in the back end.

if i run store front css,js not loading. even if i run static content deploy also my theme not listed in deploying process.

9

You must have add web folder from parent theme into your theme. After add this folder into your theme you have to run command for deploy.

php bin/magento setup:static-content:deploy
  • 1
    entire web folder not required.just i searched .its a bug i think.github.com/magento/magento2/issues/3754 – Sivakumar K May 17 '16 at 13:24
  • just add those web folder and try its working – Rakesh Jesadiya May 17 '16 at 13:25
  • As of today 2.1.7, you need to have a file inside the `web1 folder for the static-content:deploy to recognize your theme. – dchayka Sep 6 '17 at 23:52
  • i have web folder inside my theme but its not working for me – Sarvesh Tiwari Jun 12 '18 at 12:58
4

This is a bug, according to https://github.com/magento/magento2/issues/3754

In order for the child theme to have its static files generated by the setup:static-content:deploy command, there must be at least 1 static file in the /web directory.

If your child theme only has layout update files, you could create a dummy/empty image, css or js file. Therefore, Magento will consider your child theme and deploy the static files for it (in this case copy them over from the parent theme)

1

I had this issue for a while as well. I found a correct solution and @Rakesh is pretty right on this part. But the explanation is not complete.

first my theme did not show up. of course i had the have the correct Registration.php and Theme.xml file. After a

php bin/magento setup:upgrade

my theme showed up in the back-end

Then the static content deploy failed with this message

[InvalidArgumentException]
  Vendor/custom_theme argument has invalid value, available themes are: Magento/blank, Magento/luma

I had to the entire directory structure ready

etc
-view.xml
media
-preview.png
registration.php
theme.xml
web
-css
-fonts
-images
-js

But still. then i added the logo.svg to the web/images folder and a less file to the css folder and Boom all worked perfectly now!

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.