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

Navigation inline CSS gets injected despite wp_dequeue_style( 'wp-block-navigation' ); #59142

Closed
nextgenthemes opened this issue Feb 17, 2024 · 5 comments · Fixed by #60965
Closed
Assignees
Labels
[Block] Navigation Affects the Navigation Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@nextgenthemes
Copy link

nextgenthemes commented Feb 17, 2024

Description

Using WP 6.4.3 without GB active does not have this issue.

I use

add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\action_wp_enqueue_scripts', 15 );
function action_wp_enqueue_scripts(): void {

	wp_dequeue_style( 'wp-block-navigation' );
}

If I remember this right, dequeueing the styles should also remove the inline styles. I think it does so for different blocks, but I am not sure.

Some of the more recent versions of GB add this style that fucks up my styles. It should not be printed when the styles are dequeued.

How do I remove it? Is there a workaround?

.wp-block-navigation a:where(:not(.wp-element-button)) {
  color: inherit;
}

Step-by-step reproduction instructions

  1. use wp_dequeue_style( 'wp-block-navigation' );
  2. Activate GB plugin.
  3. Look the style polluting the CSS anyway.

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.4.3
GB 17.7.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@nextgenthemes nextgenthemes added the [Type] Bug An existing feature does not function as intended label Feb 17, 2024
@jordesign jordesign added [Block] Navigation Affects the Navigation Block Needs Testing Needs further testing to be confirmed. labels Feb 18, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Mar 20, 2024
@nextgenthemes
Copy link
Author

Yes, still relevant, the style may come from core/button(s) or some general GB base styles.

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Mar 21, 2024
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Apr 20, 2024
@nextgenthemes
Copy link
Author

....

@github-actions github-actions bot removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Apr 21, 2024
@t-hamano
Copy link
Contributor

Sorry for the late reply. The style is defined here and cannot be deleted with wp_dequeue_style( 'wp-block-navigation' ); because it is output as part of the global style inline CSS.

However, upon closer inspection, this style itself appears to be unnecessary. I plan to submit a PR to remove this style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants