Skip to content

Commit ca7f9ca

Browse files
authored
Merge pull request #3866 from ClickHouse/revert-3860-menu_breakpoint_improvements
Revert "Refactor of styling"
2 parents 7a59fa5 + 270443c commit ca7f9ca

File tree

28 files changed

+78
-109
lines changed

28 files changed

+78
-109
lines changed

src/components/ColorModeToggler/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import {useColorMode, useThemeConfig} from '@docusaurus/theme-common';
3-
import styles from './styles.module.scss'
3+
import styles from './styles.module.css'
44

55
export default function ColorModeToggle({className = ''}) {
66
const disabled = useThemeConfig().colorMode.disableSwitch;
@@ -25,7 +25,7 @@ export default function ColorModeToggle({className = ''}) {
2525
<path d="M8.7227 0.724664C8.7227 0.330045 8.39191 0 8.0036 0C7.60809 0 7.2773 0.330045 7.2773 0.724664V2.18834C7.2773 2.57578 7.60809 2.90583 8.0036 2.90583C8.39191 2.90583 8.7227 2.57578 8.7227 2.18834V0.724664ZM11.5991 3.4009C11.3258 3.67354 11.3258 4.13274 11.6063 4.41256C11.8796 4.6852 12.347 4.69238 12.6274 4.40538L13.6629 3.3722C13.9434 3.09238 13.9362 2.62601 13.6629 2.34619C13.3897 2.07354 12.9222 2.08072 12.649 2.35336L11.5991 3.4009ZM3.37258 4.40538C3.64584 4.6852 4.11326 4.6852 4.38652 4.41256C4.66697 4.14709 4.66697 3.66637 4.4009 3.4009L3.3582 2.35336C3.09213 2.08789 2.61753 2.07354 2.34427 2.34619C2.07101 2.62601 2.06382 3.09238 2.33708 3.36502L3.37258 4.40538ZM7.9964 11.774C10.0602 11.774 11.7717 10.0664 11.7717 8C11.7717 5.93363 10.0602 4.22601 7.9964 4.22601C5.93258 4.22601 4.22112 5.93363 4.22112 8C4.22112 10.0664 5.93258 11.774 7.9964 11.774ZM7.9964 10.4395C6.65888 10.4395 5.55146 9.33453 5.55146 8C5.55146 6.66547 6.65888 5.56054 7.9964 5.56054C9.33393 5.56054 10.4413 6.66547 10.4413 8C10.4413 9.33453 9.33393 10.4395 7.9964 10.4395ZM15.2809 8.71749C15.6692 8.71749 16 8.38744 16 8C16 7.60538 15.6692 7.28251 15.2809 7.28251H13.8211C13.4328 7.28251 13.102 7.60538 13.102 8C13.102 8.38744 13.4328 8.71749 13.8211 8.71749H15.2809ZM0.719101 7.28251C0.330787 7.28251 0 7.60538 0 8C0 8.38744 0.330787 8.71749 0.719101 8.71749H2.17888C2.57438 8.71749 2.90517 8.38744 2.90517 8C2.90517 7.60538 2.57438 7.28251 2.17888 7.28251H0.719101ZM12.6202 11.5946C12.347 11.322 11.8796 11.322 11.5991 11.5946C11.3258 11.8744 11.3258 12.3336 11.6063 12.6135L12.649 13.6538C12.9294 13.9265 13.3897 13.9193 13.6701 13.6395C13.9434 13.3668 13.9434 12.9076 13.6629 12.6278L12.6202 11.5946ZM2.33708 12.6206C2.05663 12.9004 2.05663 13.3668 2.3227 13.6395C2.60315 13.9121 3.07056 13.9193 3.34382 13.6466L4.38652 12.6135C4.66697 12.3336 4.66697 11.8744 4.4009 11.6018C4.12045 11.322 3.65303 11.322 3.37258 11.5946L2.33708 12.6206ZM8.7227 13.8117C8.7227 13.4242 8.39191 13.0942 8.0036 13.0942C7.60809 13.0942 7.2773 13.4242 7.2773 13.8117V15.2753C7.2773 15.6628 7.60809 16 8.0036 16C8.39191 16 8.7227 15.6628 8.7227 15.2753V13.8117Z" fill="currentColor"/>
2626
</svg>
2727
)}
28-
<div><span>{`${colorMode}`}</span></div>
28+
<div><span>{`${colorMode}`}</span><span className={styles.themeModeText}> Mode</span></div>
2929
</button>
3030
);
3131
}

src/components/ColorModeToggler/styles.module.scss renamed to src/components/ColorModeToggler/styles.module.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@use '../../css/breakpoints.scss' as breakpoints;
2-
31
.colorModeButton {
42
display: flex;
53
align-items: center;
@@ -21,5 +19,20 @@
2119
white-space: nowrap;
2220
}
2321

22+
@media (max-width: 1100px) {
23+
.themeModeText {
24+
display: none;
25+
}
26+
}
27+
28+
@media (max-width: 997px) {
29+
.themeModeText {
30+
display: block;
31+
}
2432

33+
.colorModeWrapper {
34+
display: flex;
35+
gap: 0.3rem;
36+
}
37+
}
2538

src/components/DocsCategoryDropdown/styles.module.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import '../../css/breakpoints.css';
2-
31
.docsNavDropdownContainer {
42
padding: 8px;
53
border-radius: 10px;
@@ -87,7 +85,7 @@
8785
transform: translateY(30px);
8886
}
8987

90-
@media (max-width: var(--mobile-breakpoint)) {
88+
@media (max-width: 768px) {
9189
.docsNavDropdownMenu {
9290
position: absolute;
9391
min-width: 95%;
@@ -203,13 +201,13 @@
203201
font-size: 0.75rem;
204202
}
205203

206-
@media screen and (max-width: var(--laptop-breakpoint)) {
204+
@media screen and (max-width: 1100px) {
207205
.docsNavDropdownContainer {
208206
padding: 0px;
209207
}
210208

211209
[data-theme="dark"] .docsNavDropdownContainer {
212-
210+
background-color: #201c1c;
213211
}
214212

215213
[data-theme="light"] .docsNavDropdownContainer {

src/components/MobileSideBarMenu/Content.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import styles from './styles.module.scss'
2+
import styles from './styles.module.css'
33
import IconClose from '@theme/Icon/Close';
44
import SearchBar from "@theme/SearchBar";
55
import clsx from 'clsx'

src/components/MobileSideBarMenu/Hamburger.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styles from './styles.module.scss'
2+
import styles from './styles.module.css'
33

44
const Hamburger = ({onClick}) =>
55
{

src/components/MobileSideBarMenu/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, {useState} from 'react';
22
import Hamburger from "./Hamburger";
33
import MobileSideBarMenuContents from './Content';
4-
import styles from './styles.module.scss';
4+
import styles from './styles.module.css';
55

66
const MobileSideBarMenu = ({sidebar}) => {
77
const [currentMenuState, setMenuState] = useState(false);

src/components/MobileSideBarMenu/styles.module.scss renamed to src/components/MobileSideBarMenu/styles.module.css

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@use '../../css/breakpoints.scss' as breakpoints;
2-
31
.docsNavBurger {
4-
display: flex;
2+
display: none;
53
}
64

75
.docsMobileMenu {
@@ -70,7 +68,6 @@
7068
margin-top: 1em;
7169
margin-bottom: 2em;
7270
}
73-
7471
.docsMobileMenu_header{
7572
margin-top: 4rem;
7673
margin-bottom: 1rem;
@@ -80,8 +77,12 @@
8077
justify-content: space-between;
8178
}
8279

83-
@media (min-width: breakpoints.$laptop-breakpoint) {
80+
@media (max-width: 1400px) {
81+
82+
}
83+
84+
@media (max-width: 996px) {
8485
.docsNavBurger {
85-
display: none;
86+
display: flex;
8687
}
8788
}

src/components/Navigation/styles.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../../css/breakpoints.scss' as breakpoints;
2-
3-
$menu-breakpoint: breakpoints.$laptop-breakpoint;
1+
$menu-breakpoint: 997px;
42

53
:root {
64
--ch-nav-v2-border-color: #dfdfdf;

src/css/breakpoints.css

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/css/breakpoints.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)