bellevue7k/span-classes

A custom button for Bard to allow a span with a class to be added to selected text.

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 2

Language:JavaScript

Type:statamic-addon

1.0 2021-05-27 06:05 UTC

This package is auto-updated.

Last update: 2024-05-28 19:51:38 UTC


README

Statamic 3.0+

This is an example Bard addon for Statamic 3 that adds a span with a class to selected content.

Installation

Install it via the composer command

composer require bellevue7k/span-classes

In your Bard editor instances (note, not the configuration view), you'll see the new button added.

Select some text, click the new icon, and select a class type, and voilà!

Output

When output, the markup will be a span with a class attached.

<p>This is my text with <span class="whiteSpace-noWrap">whiteSpace-noWrap</span> highlighted using the addon.</p>

Use on the front end

You will need to add classes to your front end stylesheets to see them come through there too.

A finished class might be whiteSpace-noWrap for example.

Your CSS for your frontend can then target that specific class.

.whiteSpace-noWrap {
    hyphens:none;
        
    /* more class types */
}

License

This addon is licensed under the MIT license.