Jun 07, 2019 in Drupal 8, Snippets

Small snippet to show how to add a class to your block

/*
 * Implements hook_preprocess_block
 */
function MYMOUDULE_preprocess_block(&$variables)
{
    if ($block_id == 'MYBLOCKID') {
        $variables['attributes']['class'][] = 'animated fadeInLeft';
    }
}