- If Advanced Content Filter is enabled, need to configure "extra allowed content" to let elements have classes.
- A catch all value is
*(*)
, which means any element can have any class added to it. - To refine this, you can limit available classes, like
*(left, right)
, which will only let "left" and "right" classes be added. - Enhanced Image (image2 plugin) can only be targeted through a "widget" type, by defining
type: 'widget'
and thenwidget: 'image'
.
Last active
August 29, 2015 14:13
-
-
Save joelstein/a171280c705c8fae0092 to your computer and use it in GitHub Desktop.
CKEditor custom styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Text Light */ | |
div.text-light, p.text-light, blockquote.text-light { | |
color: #666; | |
} | |
/* Inline List */ | |
ul.inline li { | |
display: inline; | |
} | |
/* Image Padding Left & Image Padding Right */ | |
.img-padding-left { | |
padding-left: 10px; | |
} | |
.img-padding-right { | |
padding-right: 10px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof(CKEDITOR) !== 'undefined') { | |
CKEDITOR.addStylesSet('drupal', [ | |
// "text-light" class on multiple elements. | |
{ | |
name: 'Text Light', | |
element: ['div', 'p', 'blockquote'], | |
attributes: {class: 'text-light'} | |
}, | |
// "inline" class on ul elements. | |
{ | |
name: 'Inline List', | |
element: 'ul', | |
attributes: {class: 'inline'} | |
}, | |
// "img-padding-left" and "-right" classes on image widgets. | |
{ | |
name: 'Image Padding Left', | |
type: 'widget', | |
widget: 'image', | |
attributes: {class: 'img-padding-left'} | |
}, | |
{ | |
name: 'Image Padding Right', | |
type: 'widget', | |
widget: 'image', | |
attributes: {class: 'img-padding-right'} | |
} | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment