Skip to content

Commit db68e53

Browse files
committed
Changes after CR
1 parent 43ef446 commit db68e53

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

classes/header.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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 { ';

styles.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
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])) {
@@ -119,11 +117,6 @@
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 {
@@ -132,14 +125,6 @@
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.

0 commit comments

Comments
 (0)