Declaration class

a css rule/declaration 'name: value;' such as:

color: black; @a: 2; *zoom: 1;

  • Object
  • Node
  • Declaration
Implemented types


Declaration(dynamic name, dynamic value, {String important, String merge, int index, FileInfo currentFileInfo, bool inline: false, bool variable})


important ↔ String
read / write
inline ↔ bool
read / write
merge ↔ String
read / write
name ↔ dynamic
rule/declaration left side: [...]
read / write, override-getter
treeField → Map<String, dynamic>
Fields to show with genTree
read-only, override
type → String
Node generic name == class name
value Node
rule/declaration right side
read / write, covariant, override
variable ↔ bool
read / write
allExtends ↔ List<Extend>
For extends visitor process
read / write, inherited
allowRoot ↔ bool
The Node type could be used in the root ruleset
read / write, inherited
cleanCss ↔ CleanCssContext
Info to optimize the node with cleanCss
read / write, inherited
currentFileInfo FileInfo
get fileInfo from this node or their parent
read / write, inherited
debugInfo DebugInfo
Filename and line coordinates for error debug
read / write, inherited
elements ↔ List<Element>
Selector elements
read / write, inherited
evalFirst ↔ bool
DetachedRuleset and MixinDefinition must be evaluated before other nodes in the Ruleset.eval() funciton
read / write, inherited
evaluated ↔ bool
result from bool eval, used in condition
read / write, inherited
hashCode → int
The hash code for this object.
read-only, inherited
id ↔ int
hashCode own or inherited for object comparation
read / write, inherited
index ↔ int
index from this node or their parent, position in the less file
read / write, inherited
isRuleset ↔ bool
True if is a Ruleset or MixinDefinition
read / write, inherited
nodeVisible ↔ bool
Only output css code for nodeVisible = true
read / write, inherited
operands ↔ List<Node>
For operation node
read / write, inherited
originalRuleset Node
for Rulesets and mixins process
read / write, inherited
parens ↔ bool
The node has been parsed inside parenthesis ()
read / write, inherited
parensInOp ↔ bool
for expression evaluation
read / write, inherited
parent Node
parent Node, used by index and fileInfo.
read / write, inherited
parsed ↔ bool
Some anonymous nodes are lazy parsed
read / write, inherited
rootNode ↔ bool
read / write, inherited
rules ↔ List<Node>
The ruleset rules
read / write, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
selectors ↔ List<Selector>
The ruleset selectors
read / write, inherited
visibilityBlocks ↔ int
Node visibility control
read / write, inherited


clone() Declaration
clone this Declaration
eval(Contexts context) Declaration
evalName(Contexts context, List<Node> name) → String
genCleanCSS(Contexts context, Output output) → void
clean-css output
genCSS(Contexts context, Output output) → void
genTree(Contexts env, Output output, [String prefix = '']) → void
Writes in output the tree, for debug
makeImportant() Declaration
toString() → String
Rebuild the original rule, such as color: black;
accept(VisitorBase visitor) → void
addVisibilityBlock() → void
blocksVisibility() → bool
Returns true if this node represents root of was imported by reference
copyVisibilityInfo(VisibilityInfo info) → void
This node get the visibility from info
ensureInvisibility() → void
Turns off node visibility - if called node will NOT be shown in output regardless of whether it comes from import by reference or not
ensureVisibility() → void
Turns on node visibility, that is, if called node will be shown in output regardless of whether it comes from import by reference or not
fileInfo() FileInfo
returns fileInfo from this node or their parent
fround(Contexts context, num value, [int precision]) → num
Adjust the precision of value according to context.numPrecision. 8 By default. [...]
genTreeField(Contexts env, Output output, String fieldName, dynamic fieldValue) → void
Build the subtree for a fieldName, fieldValue
genTreeTitle(Contexts env, Output output, String prefix, String type, String value) → void
Build the node tree title
getIndex() → int
returns index from this node or their parent
isCharset() → bool
Directive overrides it
isRulesetLike() → bool
isVisible() → bool
return values: false - the node must not be visible true - the node must be visible null - the node has the same visibility as its parent
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
removeVisibilityBlock() → void
setParent(dynamic nodes, Node parent) → void
Update parent property in nodes. [...]
throwAwayComments() → void
toCSS(Contexts context) → String
Returns node transformed to css code
toTree(LessOptions options) → StringBuffer
debug print the node tree
visibilityInfo() VisibilityInfo


operator ==(dynamic other) → bool
The equality operator.