Class Sass::Tree::PropNode
In: lib/sass/tree/prop_node.rb
Parent: Node

A static node reprenting a CSS property.

@see Sass::Tree

Methods

Attributes

name  [RW]  The name of the property, interspersed with {Sass::Script::Node}s representing `#{}`-interpolation. Any adjacent strings will be merged together.

@return [Array<String, Sass::Script::Node>]

resolved_name  [RW]  The name of the property after any interpolated SassScript has been resolved. Only set once \{Tree::Node#perform} has been called.

@return [String]

resolved_value  [RW]  The value of the property after any interpolated SassScript has been resolved. Only set once \{Tree::Node#perform} has been called.

@return [String]

tabs  [RW]  How deep this property is indented relative to a normal property. This is only greater than 0 in the case that:
  • This node is in a CSS tree
  • The style is :nested
  • This is a child property of another property
  • The parent property has a value, and thus will be rendered

@return [Fixnum]

value  [RW]  The value of the property.

@return [Sass::Script::Node]

Public Class methods

@param name [Array<String, Sass::Script::Node>] See \{name} @param value [Sass::Script::Node] See \{value} @param prop_syntax [Symbol] `:new` if this property uses `a: b`-style syntax,

  `:old` if it uses `:a b`-style syntax

Public Instance methods

Compares the names and values of two properties.

@param other [Object] The object to compare with @return [Boolean] Whether or not this node and the other object

  are the same

Returns a appropriate message indicating how to escape pseudo-class selectors. This only applies for old-style properties with no value, so returns the empty string if this is new-style.

@return [String] The message

Protected Instance methods

Converts nested properties into flat properties.

@param extends [Haml::Util::SubsetMap{Selector::Simple => Selector::Sequence}]

  The extensions defined for this tree

@param parent [PropNode, nil] The parent node of this node,

  or nil if the parent isn't a {PropNode}

@raise [Sass::SyntaxError] if the property uses invalid syntax

Computes the CSS for the property.

@param tabs [Fixnum] The level of indentation for the CSS @return [String] The resulting CSS

Updates the name and indentation of this node based on the parent name and nesting level.

@param extends [Haml::Util::SubsetMap{Selector::Simple => Selector::Sequence}]

  The extensions defined for this tree

@param parent [PropNode, nil] The parent node of this node,

  or nil if the parent isn't a {PropNode}

Returns an error message if the given child node is invalid, and false otherwise.

{PropNode} only allows other {PropNode}s and {CommentNode}s as children. @param child [Tree::Node] A potential child node @return [String] An error message if the child is invalid, or nil otherwise

Runs any SassScript that may be embedded in the property, and invludes the parent property, if any.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values

[Validate]