Reviewed & tested by the community
Project:
Less CSS Preprocessor
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 May 2012 at 05:56 UTC
Updated:
25 Jul 2017 at 05:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dczepierga commentedI've attach patch for review, which add support for LESS files.
It's created from the last DEV version.
Pls write does it work or not.
Greetings
Comment #2
gable commentedHello,
IMHO, this solution is too simple. It does not cope with situations when CSS compression and/or caching is on.
I can add the 'less_dir' variable to the path to css files, but it is not working when compression takes place.
Does anyone know how to solve this problem? I attach modifided fragment of code:
I know that this patch is now included to the ckeditor.lib.inc by default.
Comment #3
wwalc commentedStatus changed accordingly to the #2 comment
Comment #4
jcisio commentedWe need a hook instead of hard coding all of that...
Comment #5
pwall commentedDon't have time to throw this in a patch right now, but since the less module is already making adjustments for the wysiwyg module, I added the alter hook from this module to the less.module file (basically stealing from their wysiwyg module code and handling the query string ckeditor is adding):
Comment #6
ronan commentedThe code in #5 seems to work. Here it is as a patch against the less module
Comment #7
corey.aufang commentedI'm implementing this with essentially this:
Its a simplification since less_wysiwyg_editor_settings_alter() was already doing most of the same work.
I did a few other clean up changes that you will see in the commit as well.
Comment #9
corey.aufang commentedForgot to mark this fixed.
Please make sure that you note that this applies to the 7.x-4.x branch only.
Comment #11
kyletaylored commentedThis actually doesn't seem to work with CKEditor, or at least the documentation isn't clear about how to go about it.
Problem
I can see when defining the path to the LESS file, it does in fact show up, but is never processed. In the screenshot, you can see how far down it gets processed in the function, but never produces a CSS file.
Solution
Screenshots
CKEditor: Use Theme CSS
CKEditor: Define CSS
Also, it could be user error? Is there anything else that needs to happen for this to process correctly?
Comment #12
tommychris***DELETED, same was #13 without the upload***
Comment #13
tommychrisI have to create this patch, because Drupal adds a query string token after the less file name, and the _less_pre_render doesn't tolerate it.
Comment #14
kyletaylored commentedI recently had to revisit this ticket and I'm happy to see it working now!
The patch in #13 was definitely needed in my case. I tried multiple times without it and could never get the CSS loaded into CKEditor. Once I added it, cleared cache, it immediately started working. It also currently applies cleanly against dev.