Plugin Contributor
Ruhul
(@tips-and-tricks-hq)
Thank you. We will look into it.
Plugin Contributor
Ruhul
(@tips-and-tricks-hq)
We have completed this work in the newly released version of the plugin. Let me know if you see any issues.
Hello,
I noticed that after activating your plugin, the theme’s styles in the Gutenberg editor are lost. To resolve this issue, I had to add the following code to my theme:
function restore_theme_editor_styles() : void {
add_theme_support('editor-styles');
add_editor_style('style.css');
global $wp_styles;
if ( isset($wp_styles->registered['accept-stripe-payments-editor-style']) ) {
wp_dequeue_style('accept-stripe-payments-editor-style');
}
}
add_action('after_setup_theme', 'restore_theme_editor_styles' );
This ensures that the theme styles are correctly loaded in Gutenberg and prevents the plugin from overriding them. Without this addition, the editor loses all theme styling when the plugin is active, and the styles remain broken even when the plugin is disabled.
It seems the plugin’s editor CSS is currently overriding the theme’s styles, and implementing a solution like this would help maintain compatibility with themes.
Could you please update the plugin so that it doesn’t override theme styles in the Gutenberg editor? Implementing a solution would help ensure compatibility with themes without requiring custom code.
Thank you!
Plugin Contributor
Ruhul
(@tips-and-tricks-hq)
I am not sure where that editor style is coming from. We don’t register any plugin or theme specific styles. There is nothing with the following string in our plugin:
accept-stripe-payments-editor-style
Is this something that you may have created for a customization for your site?
I have searched our following GitHub repository for this editor style string and I can’t find anything in our codebase:
https://github.com/Arsenal21/stripe-payments
So I am trying to understand where does it get registered in the first place?
Is this something caused by the the product block API v3 change?
Thanks for your response. Using only this :
function restore_theme_editor_styles() : void {
add_theme_support('editor-styles');
add_editor_style('style.css');
}
works for restoring some lost styles, but not all of them.
So I made a strict copy of my site to a staging environment to try to understand what can be wrong, ans surprisingly, the styles are not lost in the staging environment. So I really don’t understand what’s going up.
My provider has been contacted, all caches are disabled, transcients too… I have no explanation for now.
Hello,
I wanted to let you know that with the v3 update of your block, the way Gutenberg handles theme-loaded styles has changed. This caused a latent issue related to style loading from my theme. I found that one important .css file was not loaded anymore.
I was able to identify and resolve this on my end, but it might be useful to take this into account in future updates to prevent other users from encountering the same problem, so that the plugin can be more robust.
Thank you for your work on the plugin!
Plugin Contributor
Ruhul
(@tips-and-tricks-hq)
Thank you for the update. I’ll check whether there’s anything we can improve on the plugin side to enhance this.