Skip to content

Instantly share code, notes, and snippets.

@alexmercenary
Created September 2, 2017 10:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmercenary/c67fcb28564182d1a19bc750a25aff23 to your computer and use it in GitHub Desktop.
Save alexmercenary/c67fcb28564182d1a19bc750a25aff23 to your computer and use it in GitHub Desktop.
Add UIKit text classes to CKEditor mystyles.js for ProcessWire
/**
* mystyles.js - for ProcessWire CKEditor "Custom Editor Styles Set" option
*
* Example file for "Custom Editor Styles Set" as seen in your CKEditor field config.
* This file is not in use unless you specify it for that configuration item.
*
* PLEASE NOTE:
*
* It's possible this file may be out of date since it is in /site/ rather than /wire/,
* and the version of this file will reflect whatever version you had when you first
* installed this copy of ProcessWire.
*
* If you intend to use this, you may first want to get the newest copy out of:
* /wire/modules/Inputfield/InputfieldCKEditor/mystyles.js
*
* For a more comprehensive example, see:
* /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-[version]/styles.js
*
*/
CKEDITOR.stylesSet.add( 'mystyles', [
{ name: 'Inline Code', element: 'code' },
{ name: 'Inline Quotation', element: 'q' },
{ name: 'Left Aligned Photo', element: 'img', attributes: { 'class': 'align_left' } },
{ name: 'Text - Lead', element: 'p', attributes: { 'class': 'uk-text-lead' } },
{ name: 'Text - Meta', element: 'p', attributes: { 'class': 'uk-text-meta' } },
{ name: 'Text - Small', element: 'p', attributes: { 'class': 'uk-text-small' } },
{ name: 'Text - Large', element: 'p', attributes: { 'class': 'uk-text-large' } },
{ name: 'Text - Uppercase', element: 'p', attributes: { 'class': 'uk-text-uppercase' } },
{ name: 'Text - Capitalize', element: 'p', attributes: { 'class': 'uk-text-capitalize' } },
{ name: 'Text - Lowercase', element: 'p', attributes: { 'class': 'uk-text-lowercase' } },
{ name: 'Text - Muted', element: 'p', attributes: { 'class': 'uk-text-muted' } },
{ name: 'Text - Primary', element: 'p', attributes: { 'class': 'uk-text-primary' } },
{ name: 'Text - Success', element: 'p', attributes: { 'class': 'uk-text-success' } },
{ name: 'Text - Warning', element: 'p', attributes: { 'class': 'uk-text-warning' } },
{ name: 'Text - Danger', element: 'p', attributes: { 'class': 'uk-text-danger' } },
{ name: 'Centered Photo', element: 'img', attributes: { 'class': 'align_center' } },
{ name: 'Small', element: 'small' },
{ name: 'Deleted Text', element: 'del' },
{ name: 'Inserted Text', element: 'ins' },
{ name: 'Cited Work', element: 'cite' }
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment