Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 5a6cdfc

Browse files
style: modified design
1 parent 32bb5fd commit 5a6cdfc

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

src/styles/index.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ main[class*='docMainContainer'] .container {
273273

274274
.dropdown__menu {
275275
display: grid;
276-
grid-template-columns: repeat(3, 1fr);
277-
gap: rem(1.6);
276+
gap: rem(0.8);
278277
padding: rem(1.6) rem(1.6);
279278
background-color: var(--colors-greyLight100);
280279
border-radius: rem(0.8);
@@ -291,6 +290,12 @@ main[class*='docMainContainer'] .container {
291290
}
292291
}
293292

293+
.navbar__items--right a {
294+
@media (max-width: 1201px) {
295+
font-size: rem(1.4);
296+
}
297+
}
298+
294299
.dropdown {
295300
height: 100%;
296301
padding-top: rem(2.5);
@@ -314,6 +319,8 @@ main[class*='docMainContainer'] .container {
314319
color: var(--colors-coral500);
315320
}
316321

322+
// removes language switcher from sidebar
323+
// docusaurus puts all navbaritems into sidebar in responsive design by default
317324
.menu__list-item:last-child {
318325
display: none;
319326
}

src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
33
import { useAlternatePageUtils } from '@docusaurus/theme-common/internal';
4-
import { translate } from '@docusaurus/Translate';
54
import { useLocation } from '@docusaurus/router';
65
import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
76
import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem';
@@ -34,27 +33,13 @@ export default function LocaleDropdownNavbarItem({
3433
autoAddBaseUrl: false,
3534
className:
3635
// eslint-disable-next-line no-nested-ternary
37-
locale === currentLocale
38-
? // Similar idea as DefaultNavbarItem: select the right Infima active
39-
// class name. This cannot be substituted with isActive, because the
40-
// target URLs contain `pathname://` and therefore are not NavLinks!
41-
// mobile
42-
// ? 'menu__link--active' :
43-
'dropdown__link--active'
44-
: '',
36+
locale === currentLocale ? 'dropdown__link--active' : '',
4537
};
4638
});
4739

4840
const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter];
4941

50-
// Mobile is handled a bit differently
51-
const dropdownLabel =
52-
// mobile ? translate({
53-
// message: 'Languages',
54-
// id: 'theme.navbar.mobileLanguageDropdown.label',
55-
// description: 'The label for the mobile language switcher dropdown',
56-
// }) :
57-
localeConfigs[currentLocale].label;
42+
const dropdownLabel = localeConfigs[currentLocale].label;
5843

5944
return (
6045
<DropdownNavbarItem

0 commit comments

Comments
 (0)