Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Topic: "LESS" vertas būti dar vienu "keiksmažodžiu"?

Nesu Front-End specialistas, gal but dėl to neteko anksčiau girdėti apie LESS (dynamic stylesheet language). Dėl to man įdomu kitų nuomonė apie jį. Be pagerinto css readability, kažkaip daugiau neužkliuvo kuom man jis praverstų. Nors geriau pagalvojus ir su tuo pagerintu readability dar nereiškia, kad kodas bus lengvai skaitomas (nelygų kaip rašysi).

Kas man iš pirmo žvilgsnio nepatiko, tai kad less parašyta koda kažkam reiks sukompiliuoti. Kitaip sakant papildoma apkrova serveriui arba kliento browseriui (priklauso kurioje pusėje kompiliuosi). Ir žinoma papildomas "dependency" projektui nėra pliusas.

Taigi jei kam teko su LESS susidurti, būtų įdomi nuomonė.

No warning? No action? I hate this situation!

Re: "LESS" vertas būti dar vienu "keiksmažodžiu"?

dynamic css? O kuom blogai dynamic php for css? :)


Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: "LESS" vertas būti dar vienu "keiksmažodžiu"?

O kam kompiliuoti kiekvieną kartą?
Va gabaliukas iš mano sistemos:

namespace ZendS;

class Css
{

    private static $_less = array();
    private static $_path = 'css/';
    private static $_realPath = '/static/css/';

    public static function addLess($name)
    {
        if (!in_array($name, self::$_less))
            self::$_less[] = $name;
    }

    public static function compile()
    {
        asort(self::$_less);
        $string = implode('|', self::$_less);
        $string = md5($string);
        if (!file_exists(PUBLIC_PATH . DIRECTORY_SEPARATOR . self::$_realPath . $string . '.css') || isset($_COOKIE['CSS_RECOMPILE'])) {
            $lessContent = '';
            $compiled = '';
            foreach (self::$_less as $lessFile) {
                $lc = new \ZendS\Css\Lessc(DATA_PATH . DIRECTORY_SEPARATOR . 'Less' . DIRECTORY_SEPARATOR . $lessFile);
                $compiled .= $lc->parse(NULL, array('dirImages' => '~"' . \ZendS\Url::base_url('static') . 'images/"'));
                unset($lc);
                gc_collect_cycles();
            }

            unset($lessContent);
            gc_collect_cycles();
            file_put_contents(PUBLIC_PATH . DIRECTORY_SEPARATOR . self::$_realPath . $string . '.css', $compiled);
        }
        return \ZendS\Url::base_url('static') . self::$_path . $string . '.css?v='.(defined('VERSION')?VERSION:'1.0');
    }

}

Metodas compile gražins CSS url.
\ZendS\Css\Lessc -> http://leafo.net/lessphp/

MongoDB Certified Developer
MongoDB Certified DBA
Zend Certified Engineer

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 756

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: "LESS" vertas būti dar vienu "keiksmažodžiu"?

Ajaks wrote:

dynamic css? O kuom blogai dynamic php for css? :)

Turbūt nėra skirtumo per ką generuosi (zygis ir lessphp palinkino). įdomu kada jau apsimoka pradėti žaisti su less, o kada užtenka ir ranka css parašyto (didelių projektų standartas?).

No warning? No action? I hate this situation!

Re: "LESS" vertas būti dar vienu "keiksmažodžiu"?

Na kas CSS užsiima, tie sakė, kad su Less rašyti daug patogiau.

MongoDB Certified Developer
MongoDB Certified DBA
Zend Certified Engineer

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: "LESS" vertas būti dar vienu "keiksmažodžiu"?

Less yra labai gerai, jei reikia naudoti visokį CSS3 gėrį, kaskart 5 taisyklės tam pačiam border-radius:3px? ;( O kur dar ie filtrai :(((

Kompiliavimas? Naudoji keshavimą ir nematai vargo. Jei dar freimowrkas su debug>0 automatiškai krauna naujausią versiją - jokios problemos.

Minusai:
* Editorius. Kol kas dar neradau tobulai veikiančio su less palaikymu. http://plugins.netbeans.org/plugin/32782/lesscss-module veikia neblogai, bet iki tobulumo dar toli. Gal kas žino geresnį toolsą?

* Eilučių numeriai. Dirbant su CSS ir firebug galima tiesiog nušokti į reikimą eilutę ir įpaste'inti naujas taisykles. Su less, jau turi žinoti, kur ieškot. Bet jei kodas tvarkingas - tai nebus didelė problema.