Closed (fixed)
Project:
Less CSS Preprocessor
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2012 at 04:16 UTC
Updated:
25 Jul 2013 at 19:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mstrelan commentedI've come up with a solution/workaround, which currently only works with TinyMCE editor using the WYSIWYG module. The WYSIWYG module creates a javascript setting called "content_css" which is nested deep in to Drupal.settings. The code below will traverse the js settings searching for tinymce settings with a content_css setting. It will then call _less_pre_render() with only the files included in content_css and perform the relevant checks to ensure convert the less file to a css file, or serve up the already generated css file if current.
Comment #2
mstrelan commentedI found a much cleaner approach, did not know
hook_wysiwyg_editor_settings_alter()existed.Comment #3
lotyrin commentedI like this approach. However, please provide a patch.
Comment #4
mstrelan commentedComment #5
raincloud commentedI am also interested in this hook to be implemented in the LESS module. On my site, the code above is working well, hopefully it will be present in the next version.
Comment #6
corey.aufang commentedOk, so it looks like different wysiwyg's show the css file list in a different format.
TinyMCE has $settings['content_css'] as a comma delimited string of file paths.
CKEditor has $settings['contentsCss'] which is an array of file paths.
openwysiwyg has $settings['CSSFile'] and it only allows one css file.
This opens the can of worms of multiple wysiwyg's for which support needs to be coded.
While the best solution would be for WYSIWYG to allow drupal to process the css files, which LESS would then act on, but that would require quite a change to WYSIWYG.
I agree that we need this to function, but I'm not sure if this is suited for this module, a bridge module, or if this should be something worked out on WYSIWYG's side of things.
Comment #7
raekjaer commentedI'm not a super PHP developer, but I have tried to make the suggested patch (nice approach) work with CKEditor as well as TinyMCE.
Comment #8
corey.aufang commentedI'm adding in support for tinymce, fckeditor, and ckeditor.
New dev soon.
Comment #9
corey.aufang commentedPlease check out the latest beta.
If you are still finding problems, please retag this issue with the new version as all future development for D7 will be on the 7.x-3.x branch.
Comment #10
honza pobořil commentedStill does not work. Styles loads in head section in tinymce's iframe are same (loads uncompiled .less files).
Comment #11
corey.aufang commentedIf you upgraded to 7.x-3.0-beta1 did you also update to the latest version of lessphp?
Comment #12
Anonymous (not verified) commentedI can confirm this issue in TinyMCE using version 7.x-3.0-beta1
Comment #13
Anonymous (not verified) commentedNever mind, now it appears to work just fine. Perhaps it was a caching issue.
Comment #14
corey.aufang commentedThere is now functionality in place to support the following WYSIWYGs:
tinymce
fckeditor
ckeditor
Those were the only editors that allowed for more than 1 file to be included in the editor's space.
The functionality for these is in less.wysiwyg.inc in the project, so if anyone else is able to get it working for other editors, please provide patches against this file.
Comment #15
corey.aufang commentedThis should be resolved in 7.x-3.0.