You are here

class SassExpandedRenderer in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/renderers/SassExpandedRenderer.php \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 Sass.renderers

Hierarchy

Expanded class hierarchy of SassExpandedRenderer

File

phpsass/renderers/SassExpandedRenderer.php, line 22

View source
class SassExpandedRenderer extends SassCompactRenderer {

  /**
   * Renders the brace between the selectors and the properties
   * @return string the brace between the selectors and the properties
   */
  protected function between() {
    return " {\n";
  }

  /**
   * Renders the brace at the end of the rule
   * @return string the brace between the rule and its properties
   */
  protected function end() {
    return "\n}\n\n";
  }

  /**
   * Renders a comment.
   * @param SassNode the node being rendered
   * @return string the rendered commnt
   */
  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" : '');
  }

  /**
   * Renders properties.
   * @param array properties to render
   * @return string the rendered properties
   */
  public function renderProperties($node, $properties) {
    $indent = $this
      ->getIndent($node) . self::INDENT;
    return $indent . join("\n{$indent}", $properties);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SassCompactRenderer::DEBUG_INFO_PROPERTY constant
SassCompactRenderer::DEBUG_INFO_RULE constant
SassCompactRenderer::renderDebug protected function Renders debug information. If the node has the debug_info options set true the line number and filename are rendered in a format compatible with {@link https://addons.mozilla.org/en-US/firefox/addon/103988/ FireSass}. Else if the node has the…
SassCompactRenderer::renderDirective public function Renders a directive. Overrides SassCompressedRenderer::renderDirective 1
SassCompactRenderer::renderProperty public function Renders a property. Overrides SassCompressedRenderer::renderProperty
SassCompactRenderer::renderRule public function Renders a rule. Overrides SassCompressedRenderer::renderRule
SassCompactRenderer::renderSelectors protected function Renders rule selectors. Overrides SassCompressedRenderer::renderSelectors 1
SassCompressedRenderer::getIndent protected function Returns the indent string for the node 1
SassExpandedRenderer::between protected function Renders the brace between the selectors and the properties Overrides SassCompactRenderer::between
SassExpandedRenderer::end protected function Renders the brace at the end of the rule Overrides SassCompactRenderer::end 1
SassExpandedRenderer::renderComment public function Renders a comment. Overrides SassCompactRenderer::renderComment
SassExpandedRenderer::renderProperties public function Renders properties. Overrides SassCompactRenderer::renderProperties
SassRenderer::getRenderer public static function Returns the renderer for the required render style.
SassRenderer::INDENT constant
SassRenderer::STYLE_COMPACT constant
SassRenderer::STYLE_COMPRESSED constant
SassRenderer::STYLE_EXPANDED constant
SassRenderer::STYLE_NESTED constant