__('Allele Patterns', 'allele'), 'description' => __('Patterns for Allele', 'allele'), ) ); } endif; /** * Register Block Styles */ // Hook add_action('init', 'allele_block_styles'); // Callback if (! function_exists('allele_block_styles')) : function allele_block_styles() { // Block: core/heading // Style: Basic // Via: Inline Style register_block_style( 'core/heading', array( 'name' => 'heading-basic', 'label' => __('Basic', 'allele'), 'inline_style' => ' .is-style-heading-basic { position: relative; padding-bottom: var(--wp--preset--spacing--20); } .is-style-heading-basic::after { content: ""; position: absolute; left: 0; bottom: 2px; height: 1px; width: 95%; max-width: 255px; background-color: var(--wp--preset--color--c-200); } ', ) ); // Block: core/image, core/post-featured-image // Style: Comic // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-comic', 'label' => __('Comic', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: Comic Right // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-comic-right', 'label' => __('Comic Right', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: Comic Left // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-comic-left', 'label' => __('Comic Left', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: Fancy // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-fancy', 'label' => __('Fancy', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: Shadow // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-shadow', 'label' => __('Shadow', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: Shine // Via: Block Style register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-shine', 'label' => __('Shine', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: ZoomIn // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-zi', 'label' => __('ZoomIn', 'allele'), ) ); // Block: core/image, core/post-featured-image // Style: ZoomOut // Via: theme.json register_block_style( ['core/image', 'core/post-featured-image'], array( 'name' => 'image-zo', 'label' => __('ZoomOut', 'allele'), ) ); // Block: core/navigation // Style: Basic register_block_style( 'core/navigation', array( 'name' => 'navigation-basic', 'label' => __('Basic', 'allele'), ) ); // Block: core/post-template // Style: Alternate // Via: theme.json register_block_style( 'core/post-template', array( 'name' => 'post-template-alternate', 'label' => __('Alternate', 'allele'), ) ); // Block: core/post-terms // Style: Pill // Via: theme.json register_block_style( 'core/post-terms', array( 'name' => 'post-terms-pill', 'label' => __('Pill', 'allele'), ) ); } endif; /** * Enqueue Block Stylesheets. */ // Hook add_action('init', 'allele_block_stylesheets'); // Callback if (! function_exists('allele_block_stylesheets')) : function allele_block_stylesheets() { // Block: core/button $asset = include get_parent_theme_file_path('public/css/button.asset.php'); wp_enqueue_block_style( 'core/button', array( 'handle' => 'allele-button-style', 'src' => get_parent_theme_file_uri('public/css/button.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/button.css'), ) ); // Block: core/columns $asset = include get_parent_theme_file_path('public/css/columns.asset.php'); wp_enqueue_block_style( 'core/columns', array( 'handle' => 'allele-columns-style', 'src' => get_parent_theme_file_uri('public/css/columns.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/columns.css'), ) ); // Block: core/cover $asset = include get_parent_theme_file_path('public/css/cover.asset.php'); wp_enqueue_block_style( 'core/cover', array( 'handle' => 'allele-cover-style', 'src' => get_parent_theme_file_uri('public/css/cover.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/cover.css'), ) ); // Block: core/group $asset = include get_parent_theme_file_path('public/css/group.asset.php'); wp_enqueue_block_style( 'core/group', array( 'handle' => 'allele-group-style', 'src' => get_parent_theme_file_uri('public/css/group.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/group.css'), ) ); // Block: core/image $asset = include get_parent_theme_file_path('public/css/image.asset.php'); wp_enqueue_block_style( 'core/image', array( 'handle' => 'allele-image-style', 'src' => get_parent_theme_file_uri('public/css/image.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/image.css'), ) ); // Block: core/navigation $asset = include get_parent_theme_file_path('public/css/navigation.asset.php'); wp_enqueue_block_style( 'core/navigation', array( 'handle' => 'allele-navigation-style', 'src' => get_parent_theme_file_uri('public/css/navigation.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/navigation.css'), ) ); // Block: core/post-featured-image $asset = include get_parent_theme_file_path('public/css/post-featured-image.asset.php'); wp_enqueue_block_style( 'core/post-featured-image', array( 'handle' => 'allele-post-featured-image-style', 'src' => get_parent_theme_file_uri('public/css/post-featured-image.css'), 'deps' => $asset['dependencies'], 'ver' => $asset['version'], 'path' => get_parent_theme_file_path('public/css/post-featured-image.css'), ) ); } endif; /** * Load front-end assets. */ // Hook add_action('wp_enqueue_scripts', 'allele_assets'); // Callback if (! function_exists('allele_assets')) : function allele_assets() { $asset = include get_parent_theme_file_path('public/css/screen.asset.php'); wp_enqueue_style( 'allele-style', get_parent_theme_file_uri('public/css/screen.css'), $asset['dependencies'], $asset['version'] ); } endif; /** * Load back-end assets. * enqueue_block_editor_assets: Throw Warning in FSE */ // Hook //add_action('enqueue_block_editor_assets', 'allele_block_editor_assets'); add_action('enqueue_block_assets', 'allele_block_editor_assets'); // Callback if (! function_exists('allele_block_editor_assets')) : function allele_block_editor_assets() { $style_asset = include get_parent_theme_file_path('public/css/editor.asset.php'); wp_enqueue_style( 'allele-editor', get_parent_theme_file_uri('public/css/editor.css'), $style_asset['dependencies'], $style_asset['version'] ); } endif;