You are here

public function SassExpandedRenderer::renderComment in Sassy 7.3

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

Renders a comment.

Parameters

SassNode the node being rendered:

Return value

string the rendered commnt

Overrides SassCompactRenderer::renderComment

File

phpsass/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 way. @package PHamlP @subpackage …

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" : '');
}