CKEditor 4 combinate css
Like I edited on the startpost, I found the answer myself:
Change config.js to:
CKEDITOR.editorConfig = function( config ) {
config.bodyClass = 'content'; //class that body needs to refer to
config.contentsCss = '/css/beheer.css'; //your stylesheet
CKeditor 4 skin's editor.css not appending on creating instance on different page
Unfortunately skins are registered globally for entire page. So one skin is shared with all instances of editor on page.
What you might try to do is a little hack approach. You can prepare custom skin which will combine few skins inside. Then use divarea editor type, which will inheritance css from your main page. Use 2 different div's with different class so your modification should be more specific than native css and overwrite it.
How to apply multiple styles to one element in ckeditor?
CKEditor does not currently support setting two styles on the same element from their dropdown. Have a look at this or this ticket in their tracker.
If adding the classes in the source view is not an option you may have to write your own plugin (like this SO user is doing for colors.
CKEditor 4 build (minify and uglify)
CKEditor works in two modes:
In the development (source) mode:
- you include the
ckeditor.js
file, - it loads all core files,
- it loads
config.js
(you can switch that off by setting config.customConfig to a falsy value), - it loads styles set file unless you set config.stylesSet to
false
(since 4.1RC) or an array of styles (direct setting), - it checks which plugins it should load,
- it loads plugins and dependencies of these plugins,
- it loads plugins' language files,
- it initialises all plugins,
- in the meantime a bunch of styleheet files (few for the editor UI and one for contents unless that's an inline editor) and icon files (one per button) are loaded,
- and it's ready!
- but if you open a dialog it will load the dialog's JS file; the same about e.g. the paste from word filter which is loaded on demand; the idea is that these things are not required at the beginning and they are pretty heavy, so it's better to load them later.
- you include the
In release (build) mode, which you can create using the online builder, or the presets builder or the dev builder available directly in the dev repo, things are optimized:
- you include the
ckeditor.js
file, - it contains all core files and all plugin files included in your build
config.js
andstyles.js
files are downloaded separately, but like in the development mode you can save these 2 HTTP requests,- one language file is loaded with translations for all plugins included in the build,
- all plugins are initialised,
- one stylesheet file for the editor UI and one for contents (unless that's an inline editor) are loaded plus one icons strip,
- and it's ready!
- dialog files and paste from word filter file are loaded on demand.
- you include the
Note: all JS and CSS files are minified in the release mode.
You can try to optimize few things.
- You can try to concatenate
ckeditor.js
with language file, dialogs and PSW filter files - so all JS files may be concatenated together AFAIK. - Editor UI stylesheet file can be perhaps concatenated with your page's stylesheets, but you'll have to find a way to prevent editor from loading it by itself.
- Contents stylesheet - you can remove it even if you use framed editor, but you'll need to style contents using the fullPage feature (not recommended).
- You can't merge icons strip with your strip.
That's all, I guess. I think that by default a CKEditor build is optimized very well. You can improve some things but you will not save a lot of time and you'll lose some features like automatic language recognition.
Related Topics
How to Do Math Within a Less CSS String Interpolation
Background CSS 100% Width Horizontal Scroll Issue
Targeting Nth Column (Made by Column-Count)
Scale Image with CSS But Limit to Orignial Size
How to Get Font to Display Properly in All Browsers
Why Is "Border-Color" Overridden by "Color"
Bootstrap 3 Full Width Image and Div in Container
Z-Index and Relative/Absolute Positioning
Jagged "Border" Showing Due to Background Colour on Wrapper Element with Border-Radius: 50%;
Universal CSS Selector to Match Any and All HTML Data-* Attributes
Lesscss - Ie Gradient Filter with Variables and Lighten
W3C CSS Validation Parse Error on Variables
Mix-Blend-Mode Doesn't Work on Chrome
Move The Vertical Scroll Bar of a Scroll Panel to The Left Side
How to Align One Item in The Ol to The Right While The Others Are on The Left