You are here

public function SassNestedRenderer::renderDirective in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/renderers/SassNestedRenderer.php \SassNestedRenderer::renderDirective()

Renders a directive.

Parameters

SassNode the node being rendered:

array properties of the directive:

Return value

string the rendered directive

Overrides SassCompactRenderer::renderDirective

File

phpsass/renderers/SassNestedRenderer.php, line 47

Class

SassNestedRenderer
SassNestedRenderer class. Nested style is the default Sass style, because it reflects the structure of the document in much the same way Sass does. Each rule is indented based on how deeply it's nested. Each property has its own line and is…

Code

public function renderDirective($node, $properties) {
  $directive = $this
    ->getIndent($node) . $node->directive . $this
    ->between() . $this
    ->renderProperties($node, $properties);
  return preg_replace('/(.*})\\n$/', '\\1', $directive) . $this
    ->end();
}