Skip to content

Commit 7ec16bc

Browse files
authored
Merge pull request #3881 from Blargian/fix_width
Fix width issue
2 parents 907b5dc + 0753120 commit 7ec16bc

File tree

4 files changed

+64
-38
lines changed

4 files changed

+64
-38
lines changed

src/components/Feedback/index.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export default function Feedback({side}) {
191191

192192

193193
return (
194+
<div className={styles.displayFeedback}>
194195
<Panel hasBorder alignItems='start'>
195196
<Popover open={open} >
196197
<Popover.Trigger>
@@ -212,6 +213,7 @@ export default function Feedback({side}) {
212213
selected === 'neg' && negative_feedback
213214
}
214215
</Popover>
215-
</Panel>
216+
</Panel>
217+
</div>
216218
);
217219
}
Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
1-
.Button {
2-
width: 40px;
3-
height: 40px;
4-
display: flex;
5-
align-items: center;
6-
justify-content: center;
7-
border-radius: 4px;
8-
cursor: pointer;
9-
margin-right: 8px;
10-
border: 1px solid;
11-
background-color: transparent;
12-
13-
&.dark {
14-
border-color: #323232;
15-
background-color: transparent;
16-
17-
&.selected {
18-
background-color: #282828;
1+
@use '../../css/breakpoints.scss' as breakpoints;
2+
3+
.displayFeedback {
4+
display: none;
5+
}
6+
7+
@media screen and (min-width: breakpoints.$laptop-breakpoint) {
8+
9+
.displayFeedback {
10+
display: flex;
1911
}
20-
}
2112

22-
&.light {
23-
border-color: #E6E7E9;
24-
background-color: #fff;
13+
.Button {
14+
width: 40px;
15+
height: 40px;
16+
display: flex;
17+
align-items: center;
18+
justify-content: center;
19+
border-radius: 4px;
20+
cursor: pointer;
21+
margin-right: 8px;
22+
border: 1px solid;
23+
background-color: transparent;
24+
25+
&.dark {
26+
border-color: #323232;
27+
background-color: transparent;
2528

26-
&.selected {
27-
background-color: #F6F7FA;
29+
&.selected {
30+
background-color: #282828;
31+
}
32+
}
33+
34+
&.light {
35+
border-color: #E6E7E9;
36+
background-color: #fff;
37+
38+
&.selected {
39+
background-color: #F6F7FA;
40+
}
41+
}
2842
}
29-
}
3043
}
44+
45+
46+

src/theme/DocItem/TOC/Desktop/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {useDoc} from '@docusaurus/plugin-content-docs/client';
44
import TOC from '@theme/TOC';
55
import clsx from "clsx";
66
import IconClose from '@theme/Icon/Close';
7-
import styles from './styles.module.css'
7+
import styles from './styles.module.scss'
88
import Feedback from '../../../../components/Feedback';
99

1010
const AD_DATA_ENDPOINT = 'https://cms.clickhouse-dev.com:1337/api/docs-ad'
@@ -89,7 +89,7 @@ export default function DocItemTOCDesktop() {
8989

9090
{
9191
!isClosed && title && description && href && label && (
92-
<div className={styles.docCloudCard}>
92+
<div className={styles.docCloudCardAd}>
9393
<div className={styles.docCloudCardHeader}>
9494
<h6>{title}</h6>
9595
<button

src/theme/DocItem/TOC/Desktop/styles.module.css renamed to src/theme/DocItem/TOC/Desktop/styles.module.scss

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
@use '../../../../css/breakpoints.scss' as breakpoints;
2+
13
.docTOC {
24
top: 0;
35
position: relative;
46
max-height: initial;
57
}
68

9+
.docCloudCardAd {
10+
display: none; // don't show by default on mobile
11+
}
12+
713
.docTOCContainer {
814
height: calc(100vh - (var(--ifm-navbar-height) + 2rem));
915
display: flex;
@@ -15,15 +21,6 @@
1521
top: calc(var(--ifm-navbar-height) + 1rem);
1622
}
1723

18-
.docCloudCard {
19-
background: var(--click-cloud-card-background);
20-
display: flex;
21-
flex-direction: column;
22-
padding: 1rem;
23-
border-radius: 8px;
24-
margin-bottom: 24px;
25-
}
26-
2724
.docCloudCardHeader {
2825
display: flex;
2926
flex-wrap: nowrap;
@@ -61,7 +58,18 @@
6158
}
6259

6360
@media (max-height: 700px) {
64-
.docCloudCard {
61+
.docCloudCardAd {
6562
display: none;
6663
}
6764
}
65+
66+
@media screen and (min-width: breakpoints.$laptop-breakpoint) {
67+
.docCloudCardAd {
68+
background: var(--click-cloud-card-background);
69+
display: flex;
70+
flex-direction: column;
71+
padding: 1rem;
72+
border-radius: 8px;
73+
margin-bottom: 24px;
74+
}
75+
}

0 commit comments

Comments
 (0)