theme.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 更改编辑器外观
  2. ========================================================
  3. 1. 添加"example1"风格
  4. --------------------------------------------------------
  5. 1) 添加themes/example1/example1.css,在这个文件里定义覆盖default.css里的CSS。
  6. .. sourcecode:: css
  7. .ke-container-example1 {
  8. display: block;
  9. border: 1px solid #CCC;
  10. background-color: #FFF;
  11. overflow: hidden;
  12. }
  13. .ke-container-example1 .ke-toolbar {
  14. border-bottom: 1px solid #CCC;
  15. background-color: #FFF;
  16. padding: 2px 5px;
  17. overflow: hidden;
  18. }
  19. /* 在这里继续定义其它CSS */
  20. 2) 调用编辑器时,引入example1.css,并指定themeType。
  21. .. sourcecode:: html
  22. <link rel="stylesheet" href="/editor/themes/default/default.css" />
  23. <link rel="stylesheet" href="/editor/themes/example1/example1.css" />
  24. <script charset="utf-8" src="/editor/kindeditor.js"></script>
  25. <script charset="utf-8" src="/editor/lang/zh-CN.js"></script>
  26. <script>
  27. var editor;
  28. KindEditor.ready(function(K) {
  29. editor = K.create('#editor_id', {
  30. themeType : 'example1'
  31. });
  32. });
  33. </script>