Skip to content

Commit

Permalink
Remove header bump. (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne authored Nov 13, 2024
1 parent cb56c9f commit adbb562
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
11 changes: 0 additions & 11 deletions mu-plugins/blocks/global-header-footer/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require_once __DIR__ . '/admin-bar.php';

add_action( 'init', __NAMESPACE__ . '\register_block_types' );
add_action( 'admin_bar_init', __NAMESPACE__ . '\remove_admin_bar_callback', 15 );
add_action( 'rest_api_init', __NAMESPACE__ . '\register_routes' );
add_filter( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_block_assets', 200 ); // Always last.
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_compat_wp4_styles', 5 ); // Before any theme CSS.
Expand Down Expand Up @@ -83,16 +82,6 @@ function register_block_assets() {
);
}

/**
* Remove the default margin-top added when the admin bar is used.
*
* The core handling uses `!important`, which overrides the sticky header offset in `common.pcss`.
*/
function remove_admin_bar_callback() {
remove_action( 'gp_head', '_admin_bar_bump_cb' );
remove_action( 'wp_head', '_admin_bar_bump_cb' );
}

/**
* Register REST API routes, so non-WP applications can integrate it.
*/
Expand Down
3 changes: 0 additions & 3 deletions mu-plugins/blocks/global-header-footer/postcss/_common.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
html {
--wp--custom--alignment--scroll-bar-width: 8px;

/* Offset from the top of the page which is covered by "stuck" items (admin bar & header). */
--wp-global-header-offset: calc(var(--wp-global-header-height, 0px) + var(--wp-admin--admin-bar--height, 0px));
margin-top: var(--wp-admin--admin-bar--height, 0);
height: unset; /* Let height use default browser height. */
}

Expand Down

0 comments on commit adbb562

Please sign in to comment.