Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

jacksleight/bard-paragraph-style

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published