From 4dc7b767a870d9430e982f484207794449e94483 Mon Sep 17 00:00:00 2001 From: magdev Date: Wed, 31 Dec 2025 22:16:37 +0100 Subject: [PATCH] Fix admin CSS - tabs disappeared due to overly aggressive selectors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CRITICAL FIX: The previous CSS change used .show_if_composable with !important which hid ALL elements with that class, including the tab links themselves. Changes: - Changed from .show_if_composable to .options_group.show_if_composable - Changed from .product_data_tabs .composable_options to li.composable_options - Removed !important flags (not needed with specific selectors) - Now only hides the general tab option groups, not the tab links This fixes: - Missing Composable Options tab in product edit screen - Fields appearing out of context - Tab navigation completely broken The issue was that WooCommerce adds 'show_if_composable' class to BOTH: 1. The tab link (li.composable_options.show_if_composable) 2. The general tab fields (div.options_group.show_if_composable) Now we specifically target only the option groups, leaving tabs alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- assets/css/admin.css | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index 040ad3b..42e7ff1 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -19,29 +19,23 @@ min-height: 150px; } -/* Hide composable-specific elements by default */ -.show_if_composable { - display: none !important; +/* Hide composable-specific elements by default (but not tabs) */ +.options_group.show_if_composable { + display: none; } /* Show composable elements when composable product type is selected */ -body.product-type-composable .show_if_composable, -.product-type-composable .show_if_composable { - display: block !important; -} - -/* Ensure General tab fields don't show in Composable Options panel initially */ -#composable_product_data .options_group { +body.product-type-composable .options_group.show_if_composable { display: block; } /* Hide the Composable Options tab link by default */ -.product_data_tabs .composable_options { +.product_data_tabs li.composable_options { display: none; } /* Show the Composable Options tab when composable type selected */ -body.product-type-composable .product_data_tabs .composable_options { +body.product-type-composable .product_data_tabs li.composable_options { display: block; }