Advertising sustains the DA. Ads are hidden for members. Join today

Contributed module documentation

Block Style Plugins

About

Block Style Plugins is an API module that allows a module or theme to add style options to block configuration by creating a custom plugin. It is advisable to do this primarily in themes since the majority of styles should be specific to a theme.

It allows you to define form fields on a block's configuration page which will apply classes to that block. These styles can also be restricted to only show on certain blocks so that editors aren't confused by options which shouldn't be available to them.

Dependencies

  • block
  • block_content

Tutorial Video

https://youtu.be/Y0t8owlV2_4

Setup and usage

How to setup and use the Drupal 8 Block Style Plugins module

Advanced Usage

Learn how to create an advanced plugin with PHP.

Include / Exclude styles

Restrict the visibility of styles to specific blocks with include/exclude.

Example Plugins

Find some help by looking at example plugins

Twig Templates

Apply a twig template suggestion for a block

Guide maintainers

segovia94's picture