Xarigami

project tracker

Xarigami Core [key: xgami]

All trackers
Summary
Issue List
Road Map
Changelog

Issue xgami-000876

Issue summary Details
Project:
Xarigami Core
Key:
xgami-000876
Type:
New feature
Reporter:
Lakys
Priority:
High
Severity:
Minor
Status:
Closed
Resolution:
Implemented
Owner:
Lakys
Due:
- xarigami cumulus 1.4.0
Milestone:
None

Skin var classes/ objects and style processing

Reported:  Jul 12, 2011 06:26 AM    Updated: Jul 12, 2011 06:56 AM by

Closed: Jul 12, 2011 06:56 AM    by Lakys

Version affected: - xarigami cumulus 1.4.0

The basic skin var: http://xarigami.com/contrails/display/xgami/874 Dynamic CSS: http://xarigami.com/contrails/display/xgami/875

A basic skin var is used often by getting its value (being a string, integer,...).

1. However hardcoding information for a css width, such as 3em, 520px, 40% as string, prevents any calculation.

2. One of the big feature in .LESS compiler, is the color processing, allowing to sum up color, darken, lighten directly in CSS. While this is truly powerful, .LESS compiling in PHP might be rather slow.

The intent behind skin var classes and objects, is to provide some "intelligent" objects, able to be processed, or to be combined, and rendered.

Passing from the value skin var, to the object skin var should be made really easy.

For now we provide the following skin var classes: - xarSkinColor (RGB/HSL color processing with more than twenty methods) - xarSkinSize (a simple class to handle css widths with values and units) - xarSkinGenerator (an object allowing to call some css file just like functions)

Thanks to <xar:skinvar /> you can easily control those objects and calls several methods on the same line. More documentation would follow.

Even if in theory, those objects could be called anywhere in the code, in any template, we recommend to use them in some style templates for two reasons: - skins.xt file is executed at a time when most other templates are already compiled and executed. So it is a way to have all possible skin vars, or other input settings available. - contexts are providing correct caching optimization for CSS generated files. This can work only if the inputs are well known. To conclude skins.xt (located in (themefoloder)/yourtheme/style/processing/) is used to process your already existing skin vars, add some logic and calculations, create new skin vars from those inputs (by shifting colors, darken a color, sum up some padding sizes, etc).

Note using xar:template, and type="style", you can also call sub templates from skins.xt.

Actions

implemented in core.template scenario originally

#

Issue closed by Lakys

#