Problem
You have run into a limitation of Magento’s design fall back hierarchy. The way it works is to search backwards from most specific location, to least specific.
... if your custom theme calls for a CSS file called ‘styles.css’ but the Magento application is unable to find the file in your custom theme, Magento will go to the next theme in the hierarchy to find the file ... it will continue working down the hierarchy of themes until it’s able to locate the file called ‘styles.css.’
This method of building design is called fall backs, because the application ‘falls back’ to the next possible source of required files in order to retrieve and load a requested file.
What this means for you is that the layout file local.xml
can only be sourced from one location, and it will be whatever is the most specific to the current theme. So Magento will search for it in the following priority:
app/design/frontend/$package/$theme/layout/local.xml
app/design/frontend/$package/default/layout/local.xml
app/design/frontend/base/default/layout/local.xml
The important thing to realize is that each of these files overrides the next one down, rather than adding to them. I have heard that Magento 2.x may address this situation, but for 1.x we need to work around this.
A Possible Solution
The way I would go about solving this is to create a simple extension that just loads your custom css file in a separate layout file. Then you do not need the local.xml
file in your new theme and it will continue to fall back to default
.
app/etc/modules/My_Theme.xml:
<?xml version="1.0"?>
<config>
<modules>
<My_Theme>
<active>true</active>
<codePool>local</codePool>
</My_Theme>
</modules>
</config>
app/code/local/My/Theme/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<My_Theme>
<version>0.1.0</version>
</My_Theme>
</modules>
<frontend>
<layout>
<updates>
<my_theme>
<file>my_theme.xml</file>
</my_theme>
</updates>
</layout>
</frontend>
</config>
app/design/frontend/$package/$theme/layout/my_theme.xml:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addCss"><stylesheet>css/my_theme.css</stylesheet></action>
</reference>
</default>
</layout>
This uses Magento’s design fall back method to load the file as well. So you could put this at skin/frontend/$package/$theme/css/my_theme.css
or in the $package/default/css/
subdirectory.