@AlfonsosML's second answer above is perfect for targeting the body element of the editor. However I needed to target the a tag within the editor and found his first answer broke it. I then tried the solution offered by @Doin in the comments: editor.document.addCssText() which also failed. @Doin had kindly corrected code in the the comment to editor.document.appendStyleText()
but it was hidden above. I have given his correction a 'Useful' vote so that hopefully it will be visible to others more quickly. This worked for me. My working code mixed the 2:
CKEDITOR.on('instanceReady', function(e) {
// First time
e.editor.document.getBody().setStyle('background-color', 'rgba(0,0,0,0.59)');
e.editor.document.getBody().setStyle('color', 'white');
e.editor.document.getBody().setStyle('text-align', 'center');
e.editor.document.appendStyleText( 'a { color: white; }' );
// in case the user switches to source and back
e.editor.on('contentDom', function() {
e.editor.document.getBody().setStyle('background-color', 'rgba(0,0,0,0.59)');
e.editor.document.getBody().setStyle('color', 'white');
e.editor.document.getBody().setStyle('text-align', 'center');
e.editor.document.appendStyleText( 'a { color: white; }' );
});
});
Thank you