My fundamental question is this: in Drupal 8 how can I access block field values in mytheme_preprocess_block.
I am trying to achieve something like https://www.drupal.org/project/block_class_styles in Drupal 8.
So far I have created the block field, and extracted the raw field value in twig (and then add classes or conditional statements) by doing something like:
{{ content.field_layout_style[0]['#markup']|escape }}
This looks really bad, I would rather access this field value in mytheme_preprocess_block, and then pass it to twig, and/or access it in mytheme_theme_suggestions_block_alter and make separate template suggestions based on it.
Help very much appreciated.