styles.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. // This file contains style definitions that can be used by CKEditor plugins.
  6. //
  7. // The most common use for it is the "stylescombo" plugin which shows the Styles drop-down
  8. // list containing all styles in the editor toolbar. Other plugins, like
  9. // the "div" plugin, use a subset of the styles for their features.
  10. //
  11. // If you do not have plugins that depend on this file in your editor build, you can simply
  12. // ignore it. Otherwise it is strongly recommended to customize this file to match your
  13. // website requirements and design properly.
  14. //
  15. // For more information refer to: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_styles.html#style-rules
  16. CKEDITOR.stylesSet.add('default', [
  17. /* Block styles */
  18. // These styles are already available in the "Format" drop-down list ("format" plugin),
  19. // so they are not needed here by default. You may enable them to avoid
  20. // placing the "Format" combo in the toolbar, maintaining the same features.
  21. {name: 'Paragraph', element: 'p'},
  22. {name: 'Heading 1', element: 'h1'},
  23. {name: 'Heading 2', element: 'h2'},
  24. {name: 'Heading 3', element: 'h3'},
  25. {name: 'Heading 4', element: 'h4'},
  26. {name: 'Heading 5', element: 'h5'},
  27. {name: 'Heading 6', element: 'h6'},
  28. {name: 'Preformatted Text', element: 'pre'},
  29. {name: 'Address', element: 'address'},
  30. {name: 'Italic Title', element: 'h2', styles: {'font-style': 'italic'}},
  31. {name: 'Subtitle', element: 'h3', styles: {'color': '#aaa', 'font-style': 'italic'}},
  32. {
  33. name: 'Special Container',
  34. element: 'div',
  35. styles: {
  36. padding: '5px 10px',
  37. background: '#eee',
  38. border: '1px solid #ccc'
  39. }
  40. },
  41. /* Inline styles */
  42. // These are core styles available as toolbar buttons. You may opt enabling
  43. // some of them in the Styles drop-down list, removing them from the toolbar.
  44. // (This requires the "stylescombo" plugin.)
  45. {name: 'Strong', element: 'strong', overrides: 'b'},
  46. {name: 'Emphasis', element: 'em', overrides: 'i'},
  47. {name: 'Underline', element: 'u'},
  48. {name: 'Strikethrough', element: 'strike'},
  49. {name: 'Subscript', element: 'sub'},
  50. {name: 'Superscript', element: 'sup'},
  51. {name: 'Marker', element: 'span', attributes: {'class': 'marker'}},
  52. {name: 'Big', element: 'big'},
  53. {name: 'Small', element: 'small'},
  54. {name: 'Typewriter', element: 'tt'},
  55. {name: 'Computer Code', element: 'code'},
  56. {name: 'Keyboard Phrase', element: 'kbd'},
  57. {name: 'Sample Text', element: 'samp'},
  58. {name: 'Variable', element: 'var'},
  59. {name: 'Deleted Text', element: 'del'},
  60. {name: 'Inserted Text', element: 'ins'},
  61. {name: 'Cited Work', element: 'cite'},
  62. {name: 'Inline Quotation', element: 'q'},
  63. {name: 'Language: RTL', element: 'span', attributes: {'dir': 'rtl'}},
  64. {name: 'Language: LTR', element: 'span', attributes: {'dir': 'ltr'}},
  65. /* Object styles */
  66. {name: 'Styled Image (left)', element: 'img', attributes: {'class': 'left'}},
  67. {name: 'Styled Image (right)', element: 'img', attributes: {'class': 'right'}},
  68. {
  69. name: 'Compact Table', element: 'table',
  70. attributes: {border: '1', cellpadding: '5', cellspacing: '0', bordercolor: '#ccc'}, styles: {'border-collapse': 'collapse'}
  71. },
  72. {name: 'Borderless Table', element: 'table', styles: {'border-style': 'hidden', 'background-color': '#E6E6FA'}},
  73. {name: 'Square Bulleted List', element: 'ul', styles: {'list-style-type': 'square'}},
  74. /* Widget styles */
  75. {name: 'Clean Image', type: 'widget', widget: 'image', attributes: {'class': 'image-clean'}},
  76. {name: 'Grayscale Image', type: 'widget', widget: 'image', attributes: {'class': 'image-grayscale'}},
  77. {name: 'Featured Snippet', type: 'widget', widget: 'codeSnippet', attributes: {'class': 'code-featured'}},
  78. {name: 'Featured Formula', type: 'widget', widget: 'mathjax', attributes: {'class': 'math-featured'}},
  79. {name: '240p', type: 'widget', widget: 'embedSemantic', attributes: {'class': 'embed-240p'}, group: 'size'},
  80. {name: '360p', type: 'widget', widget: 'embedSemantic', attributes: {'class': 'embed-360p'}, group: 'size'},
  81. {name: '480p', type: 'widget', widget: 'embedSemantic', attributes: {'class': 'embed-480p'}, group: 'size'},
  82. {name: '720p', type: 'widget', widget: 'embedSemantic', attributes: {'class': 'embed-720p'}, group: 'size'},
  83. {name: '1080p', type: 'widget', widget: 'embedSemantic', attributes: {'class': 'embed-1080p'}, group: 'size'},
  84. // Adding space after the style name is an intended workaround. For now, there
  85. // is no option to create two styles with the same name for different widget types. See https://dev.ckeditor.com/ticket/16664.
  86. {name: '240p ', type: 'widget', widget: 'embed', attributes: {'class': 'embed-240p'}, group: 'size'},
  87. {name: '360p ', type: 'widget', widget: 'embed', attributes: {'class': 'embed-360p'}, group: 'size'},
  88. {name: '480p ', type: 'widget', widget: 'embed', attributes: {'class': 'embed-480p'}, group: 'size'},
  89. {name: '720p ', type: 'widget', widget: 'embed', attributes: {'class': 'embed-720p'}, group: 'size'},
  90. {name: '1080p ', type: 'widget', widget: 'embed', attributes: {'class': 'embed-1080p'}, group: 'size'}
  91. ]);