Skip to content

Commit 5ba6b65

Browse files
committed
Add additional style tweaks for display issues introduced in bootstrap5
1 parent 2a57fef commit 5ba6b65

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

css/clf.drupal.css

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,52 @@ a.close:hover {
168168
border-color: #00162f;
169169
}
170170

171+
/* utilities from bootstrap5 for visibility */
172+
.collapse:not(.show):not(.in) {
173+
display: none;
174+
}
175+
176+
.collapsing {
177+
position: relative;
178+
overflow: hidden;
179+
height: 0;
180+
transition: height 0.35s ease;
181+
}
182+
183+
.collapse.in,
184+
.collapse.show {
185+
height: auto;
186+
}
187+
188+
.open > .dropdown-menu,
189+
.dropdown-menu.show {
190+
display: block;
191+
}
192+
171193
/* updating ubc7-unit-navigation mobile trigger from an a tag to a button tag alters layout, so we need to reassert the styling */
172194
#ubc7-unit .navbar .btn-navbar {
173195
height: 35px;
174196
width: 45px;
175197
padding: 11px 13px;
176-
}
198+
}
199+
200+
/* remove CLF visibility rule from global menu - the old '.in' class is no longer used, collapse behaviour now has a '.collapsing' transition state and '.show' visible state */
201+
#ubc7-global-menu #ubc7-search input,
202+
#ubc7-global-menu #ubc7-search button,
203+
#ubc7-global-menu #ubc7-global-header a {
204+
visibility: visible;
205+
}
206+
207+
/* correct issue with bootstrap 5 and boostrap 2's use of the '.show' class. In bootstrap 5, this class is used to change elements to 'display: block' */
208+
.btn-group .btn.show {
209+
display: inline-flex;
210+
place-items: center;
211+
place-content: center;
212+
}
213+
214+
/* override to ensure the desktop menu is visible on desktop regardless of collapse state */
215+
@media (min-width: 980px) {
216+
#ubc7-unit-navigation {
217+
display: block;
218+
}
219+
}

0 commit comments

Comments
 (0)