This is an example Bard addon for Statamic 3 that adds a span with a class to selected content.
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à!
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>
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 */
}
This addon is licensed under the MIT license.