You are here

public function SassNestedRenderer::renderDirective in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/renderers/SassNestedRenderer.php \SassNestedRenderer::renderDirective()

* Renders a directive. *

Parameters

SassNode the node being rendered: * @param array properties of the directive * @return string the rendered directive

Overrides SassCompactRenderer::renderDirective

File

phamlp/sass/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();
}