diff --git a/classes/frontendfile/FrontEndFileHandler.class.php b/classes/frontendfile/FrontEndFileHandler.class.php index 855f8ebf6..bd3d116b4 100644 --- a/classes/frontendfile/FrontEndFileHandler.class.php +++ b/classes/frontendfile/FrontEndFileHandler.class.php @@ -267,18 +267,19 @@ class FrontEndFileHandler extends Handler return; } + if ($default_font_config = Context::get('default_font_config')) + { + $file->vars = array_merge($file->vars, $default_font_config); + } + $compiledFileName = $file->fileName . ($minify ? '.min' : '') . '.css'; - $compiledFileHash = sha1($file->fileRealPath . ':' . serialize($vars)); + $compiledFileHash = sha1($file->fileRealPath . ':' . serialize($file->vars)); $compiledFilePath = \RX_BASEDIR . self::$assetdir . '/compiled/' . $compiledFileHash . '.' . $compiledFileName; if (!file_exists($compiledFilePath) || filemtime($compiledFilePath) < filemtime($file->fileFullPath)) { $method_name = 'compile' . $file->fileExtension; $success = Rhymix\Framework\Formatter::$method_name($file->fileFullPath, $compiledFilePath, $file->vars, $minify); - if ($success === false) - { - return; - } } $file->fileName = $compiledFileHash . '.' . $compiledFileName; diff --git a/common/css/rhymix.scss b/common/css/rhymix.scss index 3cbf9b11c..b911c63a2 100644 --- a/common/css/rhymix.scss +++ b/common/css/rhymix.scss @@ -17,6 +17,18 @@ a img { [hidden] { display: none; } +.xe_content { + font-family: $default_font_family; + font-size: $default_font_size; + line-height: $default_line_height; + word-break: $default_word_break; + @if $default_word_break == 'none' { + white-space: nowrap; + } +} +.xe_content p { + margin: 0 0 $default_paragraph_spacing 0; +} .xe_content img { max-width: 100%; height: auto; diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index 801c53851..5a519769c 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -184,11 +184,16 @@ class editorController extends editor } } } - $content_font = $editor_config->content_font; - $content_font_size = $editor_config->content_font_size; - $content_line_height = $editor_config->content_line_height; - $content_paragraph_spacing = $editor_config->content_paragraph_spacing; - $content_word_break = $editor_config->content_word_break; + + Context::set('default_font_config', array( + 'default_font_family' => $editor_config->content_font ?: 'inherit', + 'default_font_size' => $editor_config->content_font_size ?: '13px', + 'default_line_height' => $editor_config->content_line_height ?: '160%', + 'default_paragraph_spacing' => $editor_config->content_paragraph_spacing ?: '0', + 'default_word_break' => $editor_config->content_word_break ?: 'normal', + )); + + /* $buff = array(); $buff[] = ''; Context::addHtmlHeader(implode(' ', $buff)); + */ } $content = $this->transComponent($content);