[wp-trac] [WordPress Trac] #62882: "Navigation Block CSS (style.min.css) Loads Even When Gutenberg is Disabled"

WordPress Trac noreply at wordpress.org
Wed Jan 29 18:11:09 UTC 2025


#62882: "Navigation Block CSS (style.min.css) Loads Even When Gutenberg is
Disabled"
-------------------------------------+-------------------------------------
 Reporter:  jvrajput420              |      Owner:  (none)
     Type:  defect (bug)             |     Status:  assigned
 Priority:  normal                   |  Milestone:  Awaiting Review
Component:  Editor                   |    Version:  6.7.1
 Severity:  normal                   |   Keywords:  reporter-feedback 2nd-
  Focuses:  accessibility, css,      |  opinion needs-testing needs-patch
  performance                        |
-------------------------------------+-------------------------------------
 When the Classic Editor plugin is enabled, the Gutenberg block editor is
 disabled. However, the stylesheet
 '''wp-includes/blocks/navigation/style.min.css''' still loads on the
 frontend, even when block-based navigation is not used.

 This causes unnecessary CSS to be loaded, affecting site performance and
 increasing unnecessary HTTP requests.



 == **Steps to Reproduce:**
 1. Install and activate the Classic Editor plugin.
 2. Go to Appearance → Themes and activate a non-block-based theme (e.g.,
 Twenty Twenty-One).
 3. Check the frontend source code or inspect Network → CSS in Developer
 Tools.
 4. You will see that '''style.min.css?ver=6.7.1''' from '''wp-
 includes/blocks/navigation/''' is still loading.

 == **Expected Behavior:**
 * When Gutenberg is disabled, block-related CSS files should not load
 unless required.

 == **Actual Behavior:**
 * The '''wp-block-navigation''' CSS file loads unnecessarily, even when
 the site is not using block-based navigation.

 == **Workaround/Fix (Optional):**
 A possible fix is to dequeue the stylesheet when Gutenberg is disabled:

 {{{
 function remove_gutenberg_styles() {
 wp_dequeue_style('wp-block-navigation');
 }
 add_action('wp_enqueue_scripts', 'remove_gutenberg_styles', 100);
 }}}


 == **Environment:**
 * WordPress Version: 6.7.1
 * Theme: Twenty Twenty-One (or any non-block-based theme)
 * Plugins Installed: Classic Editor (latest version)
 * Server: Localhost (XAMPP, LocalWP, etc.)
 * Browser: Chrome 120.0.0.0

 == **Severity:**
 * '''Medium''' (Affects performance but does not break functionality)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62882>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list