O'Reilly logo

Magento 2 - Build World-Class online stores by Jonathan Bownds, Bret Williams, Vladimir Kerkhoff, Ray Bogman, Fernando J. Miguel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with theme variants

Let's assume we have created a new design package called sportswear_package. Within this design package, create a new theme and call it sportswear_theme. Our new design package file hierarchy, in /app/design/, might resemble the following hierarchy:

app/
  design/
    frontend/
      Magento/
        blank/
        luma/      
      sportswear_package/
        sportswear_theme/

Because we want to use the blank theme as a starting point, the theme.xml in the root directory of our theme will look something like this:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd"> <title>Sportswear Theme</title> <parent>Magento/blank</parent> <media> <preview_image>media/preview.jpg</preview_image> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required