Sha256: 47008361fbea744861f424d91e936ad438bcfdcd10eeea41b6aa9852fa8fd2eb

Contents?: true

Size: 780 Bytes

Versions: 10

Compression:

Stored size: 780 Bytes

Contents

<?php

namespace MtHaml\Filter;

use MtHaml\NodeVisitor\RendererAbstract as Renderer;
use MtHaml\Node\Filter;

abstract class Less extends AbstractFilter
{
    public function optimize(Renderer $renderer, Filter $node, $options)
    {
        $renderer->write($this->filter($this->getContent($node), array(), $options));
    }

    public function filter($content, array $context, $options)
    {
        $css = $this->getCss($content, $context, $options);

        if (isset($options['cdata']) && $options['cdata'] === true) {
            return "<style type=\"text/css\">\n/*<![CDATA[*/\n".$css."\n/*]]>*/\n</style>";
        }

        return "<style type=\"text/css\">\n".$css."\n</style>";
    }

    abstract protected function getCss($content, array $context, $options);
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.3.1 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.3.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.5 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.4 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.3 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.2 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.1 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.2.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php
guard-mthaml-0.1.0 vendor/mthaml/mthaml/lib/MtHaml/Filter/Less.php