Global Styles and Presets in the Admin
Global Styles and Presets in the Admin

You can use Global Styles and Presets to store a common configuration that you can reuse throughout your site and in the block editor.

The settings are very similar to the built-in Shortcode builder.

Presets

Presets let you create common configurations, so when you are working in the block editor, you can select a preset and apply those styles to the block. From there, you can edit your styles without starting from scratch.

Preset Options in the Admin
Preset Options in the Admin

If you are happy with a preset, you can create an additional shortcut in the block editor by enabling the option: “Show in Block Inserter.”

Your preset will then be available via the ‘/’ slash command, as well as showing up in the block sidebar as a selectable option.

Singular Alerts Block Category
Main Block With the Info Box Preset

Presets are meant to be starting points for your alert. If you edit a preset, the styles don’t automatically filter down to the block. If you’d like to make all blocks and shortcodes look the same, you will want to use a Global Style, not a preset.

Presets can be set in the block’s sidebar options and are meant as starting points.

Preset Options in the Block Sidebar With Preview
Preset Options in the Block Sidebar With Preview

Global Styles

Global Styles are meant to be copied and applied site-wide for certain alerts. For example, you want to have a set style for all “Info” and “Error” alerts, but still allow the content to be adjusted.

You can set Global Styles in the block’s sidebar options, but you must detach them to change the block’s appearance.

Global Styles in the Block Sidebar
Global Styles in the Block Sidebar

To use a Global Style in a shortcode, add a global_style attribute and reference the global style’s slug.

Shortcode
[alertsdlx global_style="info-notice" alert_title="Heading"]Body text[/alertsdlx]

Was this article helpful?

Leave a Reply