Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
separate outline css to its own function
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Nov 3, 2023
1 parent 5e8a960 commit ebb7939
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@
* @return void
*/
function twentytwentyfour_block_styles() {
/**
* The wp_enqueue_block_style() function allows us to enqueue a stylesheet
* for a specific block. These will only get loaded when the block is rendered
* (both in the editor and on the front end), improving performance
* and reducing the amount of data requested by visitors.
*
* See https://make.wordpress.org/core/2021/12/15/using-multiple-stylesheets-per-block/ for more info.
*/
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'twentytwentyfour-button-style-outline',
'src' => get_parent_theme_file_uri( 'assets/css/button-outline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/button-outline.css' ),
)
);

register_block_style(
'core/details',
Expand Down Expand Up @@ -164,6 +147,40 @@ function twentytwentyfour_block_styles() {

add_action( 'init', 'twentytwentyfour_block_styles' );

/**
* Enqueue block stylesheets.
*/

if ( ! function_exists( 'twentytwentyfour_block_stylesheets' ) ) :

Check warning on line 154 in functions.php

View workflow job for this annotation

GitHub Actions / Lint: PHP

Found precision alignment of 1 spaces.

Check failure on line 154 in functions.php

View workflow job for this annotation

GitHub Actions / Lint: PHP

Line indented incorrectly; expected 0 tabs, found 1 spaces
/**
* Enqueue custom block stylesheets
*
* @since Twenty Twenty-Four 1.0
* @return void
*/
function twentytwentyfour_block_stylesheets() {
/**
* The wp_enqueue_block_style() function allows us to enqueue a stylesheet
* for a specific block. These will only get loaded when the block is rendered
* (both in the editor and on the front end), improving performance
* and reducing the amount of data requested by visitors.
*
* See https://make.wordpress.org/core/2021/12/15/using-multiple-stylesheets-per-block/ for more info.
*/
wp_enqueue_block_style(
'core/button',
array(
'handle' => 'twentytwentyfour-button-style-outline',
'src' => get_parent_theme_file_uri( 'assets/css/button-outline.css' ),
'ver' => wp_get_theme( get_template() )->get( 'Version' ),
'path' => get_parent_theme_file_path( 'assets/css/button-outline.css' ),
)
);
}
endif;

add_action( 'init', 'twentytwentyfour_block_stylesheets' );

/**
* Register pattern categories.
*/
Expand Down

0 comments on commit ebb7939

Please sign in to comment.