Coder Social home page Coder Social logo

less's People

Contributors

bfanger avatar bfncs avatar electblake avatar hyra avatar maff- avatar ybenassuli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

less's Issues

Theme support makes bad assumptions

The new theme support assumes your app directory is one level back from webroot, this may not always be the case (and is not with mine)

Better way would be to use CAKEPHP globals ROOT and APP_DIR.

eg:

diff --git a/View/Helper/LessHelper.php b/View/Helper/LessHelper.php
index 32b2a6d..522dd94 100644
--- a/View/Helper/LessHelper.php
+++ b/View/Helper/LessHelper.php
@@ -47,11 +47,7 @@ class LessHelper extends AppHelper {
         */
        private function set_theme($theme_name) {

-       
-    $app_root = array_filter(explode(DS, WWW_ROOT));
-    
-    array_pop($app_root);
-    $app_root = implode(DS, $app_root);
+    $app_root = ROOT . DS . APP_DIR;

     $theme_path = DS.$app_root.DS.'View'.DS.'Themed'.DS.$theme_name.DS.'webroot'.DS;
                $this->lessFolder = new Folder($theme_path.'less');

Declaration of lessify::parse() should be compatible with lessc::parse (2.8.4)

CakePHP version 2.8.4

The following gave an error for "cannot find class Lessify", unsure why. Removing .Lessify from the import seemed to fix it, so I'm guessing it's something I did or didn't name properly? Who knows.

App::import('Vendor', 'Less.Lessify',
  array(
    'file' => 'lessphp/lessify.inc.php'
  )
);

So I did this:

require_once(APP . 'Vendor' . DS . 'lessphp/lessify.inc.php');

Both that and removing .Lessify gave me the same error, indicating I'm including this file properly. Now I get this:

"Declaration of lessify::parse() should be compatible with lessc::parse"

The library's three years old. Maybe something changed in the past three years?

Theme trouble and fix

Thanks so much for this awesome plugin. I was having a couple issues with it as it was not throwing any errors with my theme's css folder being unwritable. I changed a few things around so I could use the current theme's less files dynamically and use Cake's built in themePath function.

The set_theme function:

private function set_theme() {

  $theme_path = App::themePath($this->theme) . 'webroot' . DS;
  $this->lessFolder = new Folder($theme_path.'less');
  $this->cssFolder = new Folder($theme_path.'css');

}

The first part of the css helper function:

public function css($file) {

  if ($this->theme) {
    $this->set_theme();
  }
...

The helper doesn't need the second parameter now if a theme is being used. Hope this helps!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.