4

Using django-ckeditor==4.4.6, how can I override the built-in ckeditor styles.js file to add some margins to the default object styles like the one listed below?

{
name: 'Styled image (left)',
element: 'img',
attributes: { 'class': 'left', 'margin-right': '1em' }
},

I don't want to directly modify the core styles.js file, but I'm guessing that maybe I can override it using Django's app template inheritance/override functionality?

Or can I somehow feed in a js plugin that contains the above style declaration?

Dan Gayle
  • 2,277
  • 1
  • 24
  • 38
  • 2
    I noticed this question and then came across your Github issue: https://github.com/django-ckeditor/django-ckeditor/issues/152 which might be a useful link for others seeing this page – Timmy O'Mahony Mar 13 '15 at 11:37

1 Answers1

0

With "stylesSet"

{
    "default": {
        "format_tags": "h1;h2;h3;h4;p",
        "toolbar": "Custom",
        "toolbar_Custom": [
            [
                "Format",
                "Styles",
                "RemoveFormat",
                "-",
                "Bold",
                "Italic",
                "Subscript",
                "Superscript",
                "-",
                "BulletedList",
                "NumberedList",
                "-",
                "Link",
                "Unlink",
                "Anchor",
            ],
        ],
        "stylesSet": [
            {"name": "Lead Text", "element": "p", "attributes": {"class": "lead"}},
            {
                "name": "Marker: Yellow",
                "element": "span",
                "styles": {"background-color": "Yellow"},
            },
        ],
    }
}
Loscho19
  • 11
  • 2