【问题标题】:Override django-ckeditor bullet style class覆盖 django-ckeditor 项目符号样式类
【发布时间】:2021-05-25 17:40:57
【问题描述】:

我有一个与 tailwind 一起使用的 django 应用程序,我希望能够将 tailwind 类默认应用到我的项目符号列表中。

我尝试在 config.js 文件和 styles.js 文件中添加自定义样式,但由于某种原因,我在那里所做的任何更改似乎都没有更新?

我尝试运行 collect static 但它说文件未修改 0 static files copied to '/code/myproject/static', 1280 unmodified.

config.js

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';

    config.format_p={element:"p", name: "Normal", styles:{ 'color': 'red'}};


};

styles.js

CKEDITOR.stylesSet.add( 'default', [

] );

我还没有项目符号样式,但连段落更改都没有。

我意识到我可以使用 javascript 来为所有 ul 和 li 元素添加类,但如果有更清洁的解决方案,我宁愿不这样做。

【问题讨论】:

    标签: django django-ckeditor


    【解决方案1】:

    嗨,Danielle,我不知道它将如何在 Django 管理站点中工作,但这在我创建表单时帮助了我,我只是添加了这两行,然后我可以在 @ 中添加任何自定义 BootStrap 类987654323@ 所以尝试添加它并让我知道它是否有效

    config.allowedContent = true;
    config.removeFormatAttributes = '';
    

    如果它不起作用,请检查这个答案https://github.com/django-ckeditor/django-ckeditor/issues/152#issuecomment-193242094

    【讨论】:

      猜你喜欢
      • 2021-03-17
      • 2016-01-16
      • 2012-03-05
      • 1970-01-01
      • 2017-01-18
      • 2011-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多