Hierarchical Themes

TubePress themes can optionally have a parent theme by defining a parent property in the theme's manifest. This makes it very easy to tweak an existing theme, or have a family of similar themes.
This article is part of a series on TubePress themes.

TubePress themes can optionally have a parent theme by defining a parent property in the theme's manifest. This makes it very easy to tweak an existing theme, or have a family of similar themes.

Warning

Be aware that child themes can be very sensitive to changes to their parents. If you are concerned about stability, hierarchical themes may not be the right choice.

Here's how the theme hierarchy works:

  • The parent property in a theme's manifest may contain the name property of another locally-installed theme. In this case, we call the former theme a "child" and the latter its "parent."
     
  • There is no limit on the depth of the theme ancestry.
     
  • During template selection, if the active theme does not contain a particular template, the theme's ancestors will be searched. In other words, templates found in child themes take priority.
     
  • CSS and JS files will be loaded in a parents-first manner. To clarify, let's look at how CSS files are loaded in the following theme hierarchy:

    Theme name Theme parent CSS files
    grandparent none
    • css/four.css
    parent grandparent
    • css/three.css
    • css/two.css
    grandchild parent
    • css/one.css

    Assuming that the grandchild theme is active, TubePress would load all four CSS files in the following order:

    • css/four.css
    • css/three.css
    • css/two.css
    • css/one.css
       

    The same logic applies to JavaScript scripts.



Last Updated Feb 17, 2016 06:00PM PST
c65861bf7a72e1a8878bdf73cabbbdbf@tubepress.desk-mail.com
http://assets3.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete