0

I am creating a new theme. My theme has no css, js files. I have just added theme.xml and registration.php files. I have set parent theme magento/blank (in theme.xml). But my theme is not inheriting files (css,js, images) from parent theme. It was working in previous versions of magento 2. But its not working in 2.1. Please suggest.

0

I also faced this problem while creating my first theme in magento 2.0.4

Here i am showing you how i solved that:

Create a file requirejs-config.js in your theme's web folder

(app/design/frontend/Vendor Name/Theme Name/web/requirejs-config.js)

now copy and paste below code to requirejs-config.js file

var config = {
map: {
    "*": {
        "rowBuilder":             "Magento_Theme/js/row-builder",
        "toggleAdvanced":         "mage/toggle",
        "translateInline":        "mage/translate-inline",
        "sticky":                 "mage/sticky",
        "tabs":                   "mage/tabs",
        "zoom":                   "mage/zoom",
        "collapsible":            "mage/collapsible",
        "dropdownDialog":         "mage/dropdown",
        "dropdown":               "mage/dropdowns",
        "accordion":              "mage/accordion",
        "loader":                 "mage/loader",
        "tooltip":                "mage/tooltip",
        "deletableItem":          "mage/deletable-item",
        "itemTable":              "mage/item-table",
        "fieldsetControls":       "mage/fieldset-controls",
        "fieldsetResetControl":   "mage/fieldset-controls",
        "redirectUrl":            "mage/redirect-url",
        "loaderAjax":             "mage/loader",
        "menu":                   "mage/menu",
        "popupWindow":            "mage/popup-window",
        "validation":             "mage/validation/validation",
        "welcome":                "Magento_Theme/js/view/welcome"
    }
},
paths: {
    "jquery/ui": "jquery/jquery-ui"
},
deps: [
    "jquery/jquery.mobile.custom",
    "js/responsive",
    "mage/common",
    "mage/dataPost",
    "js/theme",
    "mage/bootstrap"
]
};

Now delete the 'pub\static\frontend' and 'pub\static_requirejs' folders and deploy the static content again. Flush the cache and your theme will be working fine.

P.S. Don't expect your home page working fine because Home page is different for every theme and does not come under fallback structure.

| improve this answer | |

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.