2

SOLVED (Answer below)

I had to add this to themes.json that took styles.scss and print.scss from Snowdog/blank and compiled it to my Training/default:

"default-blank": {
    "src": "vendor/snowdog/theme-blank-sass",
    "dest": "pub/static/frontend/Training/default",
    "locale": ["en_US"],
    "localeOverwrites": true,
    "stylesDir": "styles"
}

And then run sudo gulp styles --theme default-blank


All pages have no styling when I change my Magento 2 theme to my own theme that has SnowdogApps blank-sass as the parent theme.

There are a few errors in console:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://edu.dev/pub/static/frontend/Training/default/en_US/css/print.css 

Failed to load resource: the server responded with a status of 404 (Not Found)
http://edu.dev/pub/static/frontend/Training/default/en_US/css/print.css

Failed to load resource: the server responded with a status of 404 (Not Found)
http://edu.dev/pub/static/frontend/Training/default/en_US/css/styles.css 

Failed to load resource: the server responded with a status of 404 (Not Found)
http://edu.dev/pub/static/frontend/Training/default/en_US/css/print.css 

My theme in themes.json:

  "default": {
    "src": "app/design/frontend/Training/default",
    "dest": "pub/static/frontend/Training/default",
    "locale": ["en_US"],
    "localeOverwrites": true,
    "parent": "blank",
    "stylesDir": "web/css/source"
  }

Am I missing something in theme structure?

Training/default
|-Magento_Cms
|    |-web 
|         |-css
|              |-source
|                      |-_extend.scss
|-media
|      |-preview.jpg
|-web
|    |-css
|    |    |-source
|    |            |-_variables.scss
|    |            |-_extend.scss
|    |-images
0

I think you have to use the full name of the parent theme (vendor/theme) in your config file.

Snowdog/blank for the Snowdog Sass theme or Magento/blank for the original Magento theme

  • Snowdog/blank is defined as "blank" in the themes.json also. I had named it Snowdog/blank in "parent": "blank", before, but when I tried to compile sass files it said that parent theme can't be found, then I changed it to blank and it compiled successfully. – Rudolph Jan 26 '17 at 19:23
0

I had to add this to themes.json that took styles.scss and print.scss from Snowdog/blank and compiled it to my Training/default:

"default-blank": {
    "src": "vendor/snowdog/theme-blank-sass",
    "dest": "pub/static/frontend/Training/default",
    "locale": ["en_US"],
    "localeOverwrites": true,
    "stylesDir": "styles"
}

And then run sudo gulp styles --theme default-blank

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.