Skip to content

21stdigital/statamic-bard-text-styles

Repository files navigation

statamic-bard-text-styles

Statamic v3 Packagist Test Suite

This addon for Statamic allows you to select custom paragraph styles in the bard editor.

Installation

Via Composer

$ composer require tfd/statamic-bard-text-styles

Configuration

Publish the configuration:

$ php please vendor:publish --tag=bard-custom-text-styles

Open config/bard-custom-text-styles.php and add your custom paragraph styles:

return [
    'text-copy-secondary' => [
        'title' => 'text copy secondary',
        'class' => 'text-copy-secondary',
        'style' => 'font-size: 14px; color: grey;',
    ],
];

Each style must use:

  • title: The name of the style, shown in the bard select menu.
  • class: The class name, that will be added to the paragraph in the frontend.
  • styleb: The inline style, that is only applied in the bard editor itself, not the frontend.

Statamic Resources

Contributing

Please see CONTRIBUTING for details.

Development

  • run npm run watch to develop