Skip to content
Stathis Sideris edited this page Sep 27, 2011 · 12 revisions

OBSOLETE DOCUMENTATION - DO NOT READ THIS

Style

Terminology and Concepts

Clarity styles are very similar to CSS style, but the terminology differs slightly. A set of properties that describe how something should looks is called a look. The set of rules that determine whether a look should be applied to a certain component is called selector. A look combined with a selector is called style. A collection of styles is a stylesheet. The meta-data attached to a component which contributes to selecting the component for applying a look to it is called category. The category is equivalent to the concept of class in HTML/CSS.

Selectors

Selectors can select the component in the following ways:

  • By component type (whether it's a button, text field etc.)
  • By component name.
  • By component category (like a CSS class).
  • By a structural combination of any of the above (either by descendant or direct child relationship).

Colour

Colour should be recognisable in different formats:

(make (:label) (:style {:foreground "#ff0000"}))    ;;RGB
(make (:label) (:style {:foreground "#ff000020"}))  ;;RGBA
(make (:label) (:style {:foreground [255 0 0]}))    ;;RGB
(make (:label) (:style {:foreground [255 0 0 32]})) ;;RGBA

Turn on anti-alias easily:

(make (:label) (:style {:anti-alias true}))

Text

You should be able to define the size of text in a relative way:

(make (:label) (:style {:text-size "+10%"}))

or

(make (:label) (:style {:text-size "110%"}))

or

(make (:label) (:style {:text-size "x2"})) ;;times two

Styles:

{:text-style #{:italic :bold :plain :underline}) ;;obviously not all at the same time
Clone this wiki locally