Skip to content

Commit 30ae69e

Browse files
committed
Modify support dropdown menu styles
Styles modified to support on-hover behavior instead of on-click behavior and to make the dropdown transitions match the transitions of other dropdown menus in Docusaurus.
1 parent 65e685f commit 30ae69e

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

src/css/custom.css

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,46 @@ html[data-theme="dark"] .tooltip-glossary {
258258
position: relative;
259259
}
260260

261+
.supportDropdownContent {
262+
visibility: hidden; /* Prevents accidental hover issues */
263+
opacity: 0;
264+
transform: translateY(-10px); /* Moves up initially */
265+
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
266+
position: absolute;
267+
right: 0;
268+
background-color: #f9f9f9;
269+
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
270+
color: var(--ifm-color-emphasis-700);
271+
font-size: 14px;
272+
min-width: 303px;
273+
z-index: 1;
274+
}
275+
276+
/* When hovering, show the dropdown with fade-in & slide down */
277+
.supportDropdown:hover .supportDropdownContent {
278+
visibility: visible;
279+
opacity: 1;
280+
transform: translateY(0);
281+
}
282+
283+
/* Add a delay before showing the dropdown */
284+
.supportDropdownContent {
285+
transition-delay: 0.1s;
286+
}
287+
261288
.supportDropBtn {
262289
align-items: center;
263-
background-color: var(--ifm-color-secondary);
264-
border: #afafaf 1px solid;
290+
background-color: inherit;
291+
border: 0;
265292
border-radius: var(--ifm-badge-border-radius);
266-
color: #505050;
293+
color: var(--ifm-navbar-link-color);
267294
cursor: pointer;
268295
display: flex;
269-
font-size: 13.5px;
270-
font-weight: 600;
296+
font-size: 14px;
297+
font-weight: var(--ifm-font-weight-semibold);
271298
justify-content: space-between;
272-
min-width: 155px;
273-
padding: 6px 10px;
299+
min-width: 145px;
300+
padding: 6px 0;
274301
text-align: left;
275302
z-index: 1;
276303
}
@@ -281,23 +308,10 @@ html[data-theme="dark"] .tooltip-glossary {
281308
}
282309

283310
.supportDropdown:hover .supportDropBtn {
284-
border-radius: var(--ifm-badge-border-radius);
311+
color: var(--ifm-color-primary);
285312
}
286313

287-
.supportDropdownContent {
288-
background-color: #f9f9f9;
289-
box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
290-
color: var(--ifm-color-emphasis-700);
291-
display: block;
292-
font-size: 14px;
293-
min-width: 290px;
294-
position: absolute;
295-
right: 0;
296-
z-index: 1;
297-
}
298-
299-
/* Support dropdown button for mobile screens. */
300-
@media (max-width: 996px) { /* Adjust breakpoint if needed. */
314+
@media (max-width: 996px) {
301315
.supportDropBtn {
302316
font-size: 15px;
303317
}
@@ -320,13 +334,13 @@ html[data-theme="dark"] .tooltip-glossary {
320334
}
321335

322336
html[data-theme="dark"] .supportDropBtn {
323-
background-color: #505050;
324-
border: #6B7280 1px solid;
337+
background-color: inherit;
338+
border: 0;
325339
color: #f9f9f9;
326340
}
327341

328342
html[data-theme="dark"] .supportDropdownContent {
329-
background-color: #505050;
343+
background-color: var(--ifm-dropdown-background-color);
330344

331345
a {
332346
color: #f9f9f9;

0 commit comments

Comments
 (0)