PluginProbe
MaxButtons – Create buttons / 6.4
MaxButtons – Create buttons v6.4
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / assets / libraries / scssphp / src / Formatter / Expanded.php

Expanded.php in MaxButtons – Create buttons 6.4, at assets/libraries/scssphp/src/Formatter/Expanded.php

67 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * SCSSPHP
4 *
5 * @copyright 2012-2015 Leaf Corcoran
6 *
7 * @license http://opensource.org/licenses/MIT MIT
8 *
9 * @link http://leafo.github.io/scssphp
10 */
11
12 namespace Leafo\ScssPhp\Formatter;
13
14 use Leafo\ScssPhp\Formatter;
15
16 /**
17 * SCSS expanded formatter
18 *
19 * @author Leaf Corcoran <leafot@gmail.com>
20 */
21 class Expanded extends Formatter
22 {
23 /**
24 * {@inheritdoc}
25 */
26 public function __construct()
27 {
28 $this->indentLevel = 0;
29 $this->indentChar = ' ';
30 $this->break = "\n";
31 $this->open = ' {';
32 $this->close = '}';
33 $this->tagSeparator = ', ';
34 $this->assignSeparator = ': ';
35 }
36
37 /**
38 * {@inheritdoc}
39 */
40 protected function indentStr()
41 {
42 return str_repeat($this->indentChar, $this->indentLevel);
43 }
44
45 /**
46 * {@inheritdoc}
47 */
48 protected function blockLines($block)
49 {
50 $inner = $this->indentStr();
51
52 $glue = $this->break . $inner;
53
54 foreach ($block->lines as $index => $line) {
55 if (substr($line, 0, 2) === '/*') {
56 $block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line);
57 }
58 }
59
60 echo $inner . implode($glue, $block->lines);
61
62 if (empty($block->selectors) || ! empty($block->children)) {
63 echo $this->break;
64 }
65 }
66 }
67