David nice work, i think i will borrow some code from ur great plugin
when i got more exp
with sass.
I tried LESS (also less js solution) before SASS but what convince me
to SASS (scss syntax) is
compass and many more projects (aka mixins) - simply bigger response
from developers.
CLI "compass watch" is great solution for debugging scss,and real time
compiling sass scripts into css.
No need to do anything - only one line in .bashrc (screen or tmux).
Only one problem - no good support for IDE under LInux.
I also think that DIEM need css preprocessor ( read css framework )
there is symfony for php and jquery for javascript why not sth like
that for css? to ease work and speed development
David please post your problems,ideas about less/sass for DIEM, if u
got any.
On 25 Lut, 15:31, djacquel <
david.jacq...@gmail.com> wrote:
> I've already explained how I use less with Diem here<
http://groups.google.com/group/diem-users/browse_thread/thread/8b20c1...>
>
> But things are evolving so this is a new howto.
> And I always think that css preprocessor is a must have for Diem.
> My choise is to run less to css transform on server side because I think
> that is not the browser responsibility to parse less files.
> sfLESSPlugin documentation explain how to do it with node.js but it's not an
> option for me. I decided to use 'lessphp' parser instead.
>
> *1 - Install sfLESSPlugin*
> *Note* : If you do it with a "symfony plugin:install sfLESSPlugin" you will
> not get the last version, I think it's better to do it with git
>
> *2 - Install lessphp parser*
> *Note* : sfLESSPlugin already includes lessphp as a submodule but it was
> impossible to init so I do it this way.
>
> *3 - Activate sfLESSPlugin in config/ProjectConfiguration.php*
> public function setup()
> {
> parent::setup();
> $this->enablePlugins(array(
> // add plugins you want to enable here
> *'sfLESSPlugin'*
> ));
> $this->setWebDir(sfConfig::get('sf_root_dir').'/web');
> }
>
> *4 - Modify /plugins/sfLESSPlugin/lib/config/sfLESSConfig.class.php*
>
> To take into account that Diem stores his css in a theme folder
>
> public function getCssPaths()
> {
> // return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) .
> '/css/';
> // replaced by
> $path = sfConfig::get('app_sf_less_plugin_css_path', '/css/');
> return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) .
> $path;
> }
>
> public function getLessPaths()
> {
> // return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) .
> '/less/';
> // replaced by
> $path = sfConfig::get('app_sf_less_plugin_less_path', '/less/');
> return sfLESSUtils::getSepFixedPath(sfConfig::get('sf_web_dir')) .
> $path;
> }
>
> *5 - modify /plugins/sfLESSPlugin/lib/less/sfLESS.class.php*
>
> replace the callLesscCompiler method by this one :
>
> public function callLesscCompiler($lessFile, $cssFile)
> {
> try
> {
> $less = new lessc( $lessFile );
> $css = $less->parse();
> file_put_contents( $cssFile, $css );
> return $css;
> }
> catch (exception $e)
> {
> return false;
> }
> }
>
> *6 - Add configuration to apps/front/config/app.yml*
> Add
> all:
> sf_less_plugin:
> compile: true
> use_js: false
> check_dates: true
> css_path: /theme/css/
> less_path: /theme/less/
>
> *7 - Run a* ./symfony dm:setup && ./symfony cc
>
> *8 - Make sure your web/theme/css (or wathever is your theme folder) to be
> writable*
>
> And you can use less preprocessor !
> Just create your web/theme/less/layout.less, for example, edit it, add
> variables, mixins, etc and any change made will be reflected in your
> web/theme/css/layout.css file
>
> *Useful URLs :*
> - LESS css doc <
http://leafo.net/lessphp/docs/>
> - LESS php parser <
https://github.com/leafo/lessphp/>
> - sfLESSPlugin <
https://github.com/everzet/sfLESSPlugin/>