The system for loading CSS files is similar to the system for finding layout
templates. Which CSS files are loaded for a page is determined by the
conf/css-files.xml. The root element of this file is an
css-files element. This element has multiple application
child elements. Each application has an mandatory attribute
name which contains the name of the application for which the CSS files
named in the element are loaded. There should be also an default
element which determines the CSS files to load when no matching
application element is found.
The name of an application is generated as follows:
-
If the data tree contains an
applicationattribute the value of this attribute is used as name of the current application. -
If there is no
applicationbut anclassattribute the value of theclassattribute is used as name of the current application. -
If there is no
applicationand noclassattribute the name of the current application is set tonone.
Each application element and the default element
in css-files.xml can contain multiple css-file element.
Each of the css-file elements defines a single XML to load.
The css-file element has two optional attributes:
- media
-
The media type, for example
screenorprintfor which the CSS file is used. The value of this attribute will appear in the media attribute of thelinkelement which is generated in the HTML to load the CSS file. - origin
-
The origin of the CSS file. If not set the file is loaded from the current
theme. If set to
masterthe file is loaded from the master theme if the current theme is a child theme. If set tointernalthe file is loaded from the internal directory for CSS files, either from the current theme (if the current theme is a master theme) or from the Foundry master theme installed at/themes/foundry.