S2 Guide: Style System Overview
Contents
Layers
<graphviz caption='Order of layers'> digraph layers { core_layer [shape="doubleoctagon" color="#002F74" fontcolor="black"]; layout_layer [shape="doubleoctagon" color="#444F96" fontcolor="black"]; theme_layer [shape="doubleoctagon" color="#886FA8" fontcolor="black"]; wizard_layer [shape="doubleoctagon" color="#BB8FCA" fontcolor="black"];
core_layer -> layout_layer layout_layer -> theme_layer theme_layer -> wizard_layer } </graphviz>
Core layer
The core layer is the foundation everything else builds on. It can:
- Define classes
- Define builtin functions that are present in the backend
- Define global functions that don't belong to a class
- Define class methods
- Define and set properties
Dreamwidth has two different core layers.
- core1 is inherited from LiveJournal and allows people to import their LiveJournal layouts.
- core2 is Dreamwidth's core layer, that includes extra features built in, like modules. Plain Tabula Rasa is the base style put out by core2 without any modifications.
Layout layer
- Define builtin functions that are present in the backend
- Define global functions that don't belong to a class
- Define class methods; the method name must have the prefix lay_ to avoid future namespace collisions if the core layer expands
- Define and set properties
- Set up properties for the customization wizard
Theme layer
A theme layer can:
- Override existing functions
- Override names and descriptions of properties
It's usually used to make different versions to a base layout, such as different color schemes.
Wizard layer
All a wizard layer can do is set properties. It's meant to be edited by using the customize interface on the site, but can also be created or edited manually. (If you're familiar with styles on LiveJournal, this was called the "user layer".)