@const rule allows to define some named and constant value and use that value in forecoming style declarations as a value of style attribute.
Sample of such const declaration (CSS+):
/* declaration of the constant: */
@const BASE_COLOR: #00FF00;
/* style declaration using such constant: */
#myelement { border: 1px solid @BASE_COLOR; }
First line here defines BASE_COLOR constant and in last line it is used as a value of attribute.
@const rule is using following notation:
@const name [, name1 [, name2 ... ]] : values ;
collection of values (after ':' ) will be assigned to constant(s) on the left side. values here is a sequence of attribute values alllowed by CSS. It can be single value (as #00FF00 above) or set of values defining compound (shortcut) attribute. For example here is definition of constant that define set of background attributes as a single entity.
@const MY_BACKGROUND: yelllow repeat url(hatch.png);
#myelement { background: @MY_BACKGROUND; }
Insertion point of the constant is marked by symbol '@' immediately followed by name of the constant used in correspondent @const declaration.
scope rules of the @const are simple: