jacksleight/bard-paragraph-style

This package is abandoned and no longer maintained. The author suggests using the jacksleight/statamic-bard-texstyle package instead.
There is no license information available for the latest version (1.2.3) of this package.

1.2.3 2022-05-05 09:53 UTC

This package is auto-updated.

Last update: 2022-08-15 12:40:49 UTC


README

Statamic Packagist version License

Bard Paragraph Style

⚠️ Do Not Use: This addon has been superseded by Bard Texstyle, which offers everything this does and more. If you're using this already check the migration guide.

This Statamic addon gives you the ability to add custom paragraph styles to the Bard fieldtype.

Installation

Install the addon using Composer:

composer require jacksleight/bard-paragraph-style

Configuration

Publish the config:

php please vendor:publish --tag=bard-paragraph-style-config

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

return [

    'styles' => [
        [
            'name'   => 'Introduction Paragraph',
            'ident'  => 'I',
            'class'  => 'intro',
            'button' => 'introduction',
            'cp_css' => 'font-size: 1.25em',
        ],
    ],

];

Each style should consist of:

  • name (string): The name of the style. This will appear in the button tooltip.
  • ident (string): A short identification string (one or two characters). This will appear in the button icon.
  • class (string): The class name that will be applied to the paragraph element when rendered on the site.
  • button (string): The name of the button that'll be added to the Bard field's buttons list.
  • cp_css (string): The CSS properties that will be added to the control panel for this style.

Finally open your blueprint or fieldset YAML file and add the button(s) to your Bard field's buttons list:

-
  handle: my_field
  field:
    type: bard
    buttons:
      - introduction