Closed (duplicate)
Project:
Wysiwyg
Version:
7.x-2.1
Component:
Editor - TinyMCE
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2012 at 17:22 UTC
Updated:
8 Jul 2012 at 21:57 UTC
I am using LESS CSS preprocessor for my theme styles and TinyMCE editor. I have problem with styling editor's iframe content because styles given there are not processed by Less.
Correctly processed styles in main document looks like this:
<style type="text/css" media="all">
@import url("http://localhost:8888/www-ttmos-cz/sites/default/themes/ttmos/css/style.css?m6ssuo");
@import url("http://localhost:8888/www-ttmos-cz/sites/default/files/less/4ff86cfc360b82.09540208/sites/default/themes/ttmos/css/default.css?m6ssuo");</style>- imported correct proceessed CSS code
But styles imports in editors's iframe looks like this:
<link type="text/css" rel="stylesheet" href="http://localhost:8888/www-ttmos-cz/sites/default/themes/ttmos/css/style.css">
<link type="text/css" rel="stylesheet" href="http://localhost:8888/www-ttmos-cz/sites/default/themes/ttmos/css/default.css.less">- editor uses unprocessed CSS/LESS code
Comments
Comment #1
twodI'm not sure this is strictly a bug in Wysiwyg, nor anywhere else. But it is annoying...
The LESS CSS Preprocessor module only hooks into the rendering of the style/link tags and changes the file endings there. The actual list of stylesheets added to the page, statically kept by Drupal and fetchable via drupal_add_css() or drupal_get_css(), is not changed at all. Wysiwyg, which uses drupal_add_css(), doesn't render the actual tags since it just needs to pass the filenames to the editor. Since there's no rendering, the LESS module's #pre_render callback isn't executed.
This problem has already been approached by the other module in #1474184: WYSIWYG does not load less styles though. They're basically implementing Wysiwyg's settings hook to alter the filenames directly in the list Wysiwyg passes to the editor. There are a few quirks to that since each editor needs the list in a different format, and some editors only accept one file, if any at all. They seem to have CKEditor and TinyMCE covered so far though.
I'll mark this issue as a duplicate of that issue for now.