Magento2 design fallback logic

The point is, compared to Magento 1, where a pseudo fallback mechanism was implemented. Magento 2 has a mechanism that falls back as many times as a parent theme can be found. The system is very similar to the one introduced on Magento 1.9 using theme.xml files.

For instance, when you have 5 themes inheriting from each other, then the mechanism will fall back to each one of them. The package is not taken into consideration anymore.

Here is a pseudo code that can describe the new design mechanisme:

do
    look in the current theme
    current theme will be parent theme on the next iteration
while the current theme has a parent theme

look in the view folder of the module area if the layout/template is not defined in the previous steps

As an example of static file fallback, suppose there is a request for the logo.svg image in the Blank theme.

Using theme inheritance and view file fallback rules, Magento uses the following search order:

  1. app/design/frontend/Magento/blank/web/images/logo.svg
  2. app/design/frontend/Magento/blank/web/logo.svg
  3. app/design/frontend/Magento/parent_theme/web/images/logo.svg
  4. app/design/frontend/Magento/parent_theme/web/logo.svg

Reference: http://devdocs.magento.com/guides/v2.0/architecture/view/static-process.html