GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

How to apply style tag in properties window? #515

Open harshitaparmar opened 5 years ago

anthonyjb commented 5 years ago

Hi @harshitaparmar,

Here's an example taken from a recent project:

// Add custom class styles for the site
ContentTools.StylePalette.add([
    new ContentTools.Style(
        'Highlight - Apply a highlight tag to bold content',
        'highlight',
        ['h1', 'h2', 'h3', 'li', 'p']
    ),
    new ContentTools.Style(
        'Large text - Increase font size',
        'large-text',
        ['p']
    ),
    new ContentTools.Style(
        'Margin - Increase paragraph spacing',
        'large-spacing',
        ['p']
    ),
    new ContentTools.Style(
        'Table - Alternative table style',
        'table--alternative',
        ['table']
    ),
    new ContentTools.Style('Image caption', 'image-caption', ['p'])
])
anthonyjb commented 5 years ago

@harshitaparmar I'm hoping the above is what you're asking about - if I've misunderstood can provide a slightly more detailed question please.