You are here

public function SassExpandedRenderer::renderComment in Sassy 7

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

* Renders a comment. *

Parameters

SassNode the node being rendered: * @return string the rendered commnt

Overrides SassCompactRenderer::renderComment

File

phamlp/sass/renderers/SassExpandedRenderer.php, line 44

Class

SassExpandedRenderer
SassExpandedRenderer class. Expanded is the typical human-made CSS style, with each property and rule taking up one line. Properties are indented within the rules, but the rules are not indented in any special…

Code

public function renderComment($node) {
  $indent = $this
    ->getIndent($node);
  $lines = explode("\n", $node->value);
  foreach ($lines as &$line) {
    $line = trim($line);
  }
  return "{$indent}/*\n{$indent} * " . join("\n{$indent} * ", $lines) . "\n{$indent} */" . (empty($indent) ? "\n" : '');
}