Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove custom admin header spacing modifications. #665

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading