Difference between revisions of "S2 Guide: Style System Overview"

From Dreamwidth Notes
Jump to: navigation, search
Line 1: Line 1:
 +
= Layers =
  
 
<graphviz caption='Order of layers'>
 
<graphviz caption='Order of layers'>
Line 12: Line 13:
 
}
 
}
 
</graphviz>
 
</graphviz>
 +
 +
== Core layer ==
 +
 +
The core layer is the foundation everything else builds on.  It can:
 +
 +
* Define classes
 +
* Define <tt>builtin</tt> 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.
 +
 +
* <tt>core1</tt> is inherited from LiveJournal and allows people to import their LiveJournal layouts.
 +
* <tt>core2</tt> is Dreamwidth's core layer, that includes extra features built in, like modules.  Plain Tabula Rasa is the base style put out by <tt>core2</tt> without any modifications.
 +
 +
== Layout layer ==
 +
 +
* Define <tt>builtin</tt> 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 <tt>lay_</tt> 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".)
 +
 +
== Language layers ==
 +
 +
=== i18nc: core ===
 +
 +
=== i18n: layout ===
 +
  
 
[[Category: S2 Guide]]
 
[[Category: S2 Guide]]

Revision as of 17:48, 15 June 2010

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".)

Language layers

i18nc: core

i18n: layout