Skip to content

Commit 6533468

Browse files
committed
Refactor CSS for assistant component: adjust media queries and container widths for better responsiveness
1 parent 07495a8 commit 6533468

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

docs/source/_static/css/nwb_assistant.css

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
display: none;
2727
}
2828

29-
@media (min-width: 1300px) {
29+
/* Show assistant on screens 768px and wider */
30+
@media (min-width: 768px) {
3031
.assistant-toggle {
3132
display: block;
3233
}
@@ -37,7 +38,7 @@
3738
position: fixed;
3839
right: 0;
3940
top: 0;
40-
width: calc(100vw - 1140px);
41+
width: 400px;
4142
height: 100vh;
4243
z-index: 1000;
4344
transform: translateX(100%);
@@ -60,7 +61,50 @@
6061
transition: margin-right 0.3s ease-in-out;
6162
}
6263

64+
.assistant-container.show ~ .wy-nav-content {
65+
margin-right: 400px;
66+
}
67+
}
68+
69+
/* For larger screens, use more available space */
70+
@media (min-width: 1300px) {
71+
.assistant-container {
72+
width: calc(100vw - 1140px);
73+
}
74+
6375
.assistant-container.show ~ .wy-nav-content {
6476
margin-right: calc(100vw - 1140px);
6577
}
6678
}
79+
80+
/* For mobile devices, make assistant full-screen overlay */
81+
@media (max-width: 767px) {
82+
.assistant-toggle {
83+
display: block;
84+
}
85+
86+
.assistant-container {
87+
display: block;
88+
visibility: hidden;
89+
position: fixed;
90+
right: 0;
91+
top: 0;
92+
width: 100vw;
93+
height: 100vh;
94+
z-index: 1000;
95+
transform: translateX(100%);
96+
transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
97+
}
98+
99+
.assistant-container.show {
100+
visibility: visible;
101+
transform: translateX(0);
102+
}
103+
104+
.assistant-iframe {
105+
width: 100%;
106+
height: 100%;
107+
border: none;
108+
background: white;
109+
}
110+
}

0 commit comments

Comments
 (0)