Leafo\ScssPhp\Compiler::compileDirective PHP Method

compileDirective() protected method

Compile directive
protected compileDirective ( Leafo\ScssPhp\Block $block )
$block Leafo\ScssPhp\Block
    protected function compileDirective(Block $block)
    {
        $s = '@' . $block->name;
        if (!empty($block->value)) {
            $s .= ' ' . $this->compileValue($block->value);
        }
        if ($block->name === 'keyframes' || substr($block->name, -10) === '-keyframes') {
            $this->compileKeyframeBlock($block, [$s]);
        } else {
            $this->compileNestedBlock($block, [$s]);
        }
    }
Compiler