File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed
Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -391,12 +391,19 @@ private function get_tabs(course_modinfo $modinfo, \renderer_base $output): \for
391391 // Apply the border to the tabs container when this specific tab is active.
392392 // Only generate CSS if a background color is defined.
393393 if (!empty ($ activebackgroundcolor ) && ($ type === 'active ' || $ type === 'default ' )) {
394+ // Add border bottom for horizontal tabs.
394395 $ onecss .= '#tabs-tree-start:has(#onetabid- ' . $ thissection ->id . ' a.nav-link.active) ' ;
395396 $ onecss .= '.format_onetopic-tabs { ' ;
396397 $ onecss .= 'border-bottom: 2px solid ' . $ activebackgroundcolor . ' !important; ' ;
397398 $ onecss .= 'padding-bottom: 1px; ' ;
398399 $ onecss .= '} ' ;
399- $ onecss .= '#onetabid- ' . $ thissection ->id . ' .nav-link.active { border-color: ' . $ activebackgroundcolor . '; } ' ;
400+ $ onecss .= '#onetabid- ' . $ thissection ->id . ' .nav-link.active { border-color: ' . $ activebackgroundcolor . '; } ' ;
401+ // Deny border for parent tab.
402+ $ onecss .= '#tabs-tree-start .tabs-wrapper .format_onetopic-tabs:has(#onetabid- ' . $ thissection ->id . '.haschilds a.nav-link.active) ' ;
403+ $ onecss .= '{ ' ;
404+ $ onecss .= 'border-bottom: 2px solid lightgray !important; ' ;
405+ $ onecss .= '} ' ;
406+ // Add border left for vertical tabs.
400407 $ onecss .= '#tabs-tree-start.verticaltabs .tabs-wrapper ' ;
401408 $ onecss .= ':has(#onetabid- ' . $ thissection ->id . ' a.nav-link.active) ' ;
402409 $ onecss .= '.format_onetopic-tabs { ' ;
Original file line number Diff line number Diff line change 108108 }
109109 }
110110
111- // Store background-color for active tabs to use in border CSS.
112- $ activebackgroundcolor = null ;
113111 foreach ($ styles as $ key => $ value ) {
114112 // If exist a unit for the rule, apply it.
115113 if (isset ($ units [$ key ])) {
119117 $ value = $ value . 'px ' ;
120118 }
121119
122- // Capture background-color for active tabs.
123- if ($ type === 'active ' && $ key === 'background-color ' ) {
124- $ activebackgroundcolor = $ value ;
125- }
126-
127120 if ($ key == 'others ' ) {
128121 $ csscontent .= $ value . '; ' ;
129122 } else {
132125 }
133126
134127 $ csscontent .= '} ' ;
135-
136- // Add border CSS for .format_onetopic-tabs when processing active tab with background-color.
137- if ($ type === 'active ' && !empty ($ activebackgroundcolor )) {
138- $ csscontent .= '#tabs-tree-start .format_onetopic-tabs { ' ;
139- $ csscontent .= 'border-bottom: 2px solid ' . $ activebackgroundcolor . ' !important; ' ;
140- $ csscontent .= 'padding-bottom: 1px; ' ;
141- $ csscontent .= '} ' ;
142- }
143128 }
144129
145130 // Clean the CSS for html tags.
You can’t perform that action at this time.
0 commit comments