Skip to content

Commit 9ec925c

Browse files
Revathyvenugopal162pyansys-ci-botMaxJPReyjorgepiloto
authored
fix: smaller screen view and search for mobile views (#689)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Maxime Rey <[email protected]> Co-authored-by: Jorge Martínez <[email protected]>
1 parent dd816ff commit 9ec925c

File tree

5 files changed

+287
-159
lines changed

5 files changed

+287
-159
lines changed

doc/changelog.d/689.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
smaller screen view and search for mobile views

src/ansys_sphinx_theme/assets/styles/ansys-sphinx-theme-variable.scss

Lines changed: 106 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
:root {
1717
/** Ansys specific changes to the theme */
18-
1918
/**
2019
* Ansys Font family
2120
*
@@ -52,6 +51,7 @@
5251
--bs-nav-link-font-size: 0.875rem; /* 14px */
5352
--bs-navbar-color: var(--bs-ast-navbar-color);
5453
--ast-font-sidebar-header: 1rem; /* 16px */
54+
5555
/**
5656
* weight
5757
*/
@@ -401,7 +401,7 @@ html[data-theme="dark"] {
401401
body {
402402
font-family: var(--ast-body-family);
403403
line-height: var(--ast-global-line-height);
404-
font-size: 14px;
404+
font-size: 0.875rem; // 14px
405405
color: var(--ast-color-text);
406406
}
407407

@@ -420,5 +420,108 @@ h6 {
420420
}
421421

422422
h1 {
423-
line-height: 56px;
423+
line-height: 3.5rem; // 56px
424+
}
425+
426+
427+
/* Mobile-specific overrides (≤ 1200px) */
428+
@media (max-width: 1200px) {
429+
.navbar-header-items {
430+
display: none !important;
431+
flex-grow: 1 !important;
432+
padding: 0 0 0 0.5rem !important;
433+
}
434+
435+
ul.navbar-nav {
436+
align-items: baseline;
437+
}
438+
439+
.navbar-center-items .navbar-item {
440+
display: inline-block;
441+
}
442+
443+
.navbar-persistent--mobile {
444+
display: none;
445+
}
446+
447+
.navbar-persistent--container {
448+
display: flex;
449+
}
450+
451+
.bd-sidebar-primary {
452+
flex-grow: 0.75;
453+
height: 100vh;
454+
left: 0;
455+
margin-left: -75%;
456+
max-height: 100vh !important;
457+
max-width: 21.875rem !important; // 350px
458+
position: fixed;
459+
top: 0;
460+
transition: visibility 0.2s ease-out,margin 0.2s ease-out;
461+
visibility: hidden;
462+
width: 75%;
463+
z-index: 1050;
464+
display: flex !important;
465+
}
466+
467+
.bd-sidebar-primary[open] {
468+
visibility: visible !important;
469+
}
470+
471+
button.primary-toggle {
472+
display: flex !important;
473+
}
474+
475+
#pst-collapse-sidebar-button {
476+
display: none !important;
477+
}
478+
479+
nav.bd-links {
480+
display: block !important;
481+
}
482+
483+
.nav-link .hide-on-wide {
484+
display: none !important;
485+
}
486+
487+
.bd-sidebar-primary.hide-on-wide {
488+
display: flex !important;
489+
}
490+
491+
.bd-sidebar-primary .sidebar-header-items {
492+
display: flex !important;
493+
}
424494
}
495+
496+
/* Desktop-specific overrides (> 1200px) */
497+
@media (min-width: 1200px) {
498+
.navbar-header-items {
499+
display: inherit;
500+
flex-grow: 1;
501+
padding: 0 0 0 0.5rem;
502+
}
503+
504+
ul.navbar-nav {
505+
align-items: baseline;
506+
}
507+
508+
.navbar-center-items .navbar-item {
509+
display: inline-block;
510+
}
511+
512+
.navbar-persistent--mobile {
513+
display: none;
514+
}
515+
516+
.navbar-persistent--container {
517+
display: flex;
518+
}
519+
520+
.bd-sidebar-primary {
521+
font-size: var(--pst-sidebar-font-size);
522+
}
523+
524+
button.primary-toggle {
525+
display: none;
526+
}
527+
}

src/ansys_sphinx_theme/assets/styles/ast-search.scss

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/* Static Search Results Container */
2+
3+
.bd-search{
4+
display: flex;
5+
}
26
.static-search-results {
37
display: flex;
48
flex-direction: column;
@@ -80,10 +84,6 @@ html[data-theme="light"] .highlight {
8084
.bd-search .search-button__kbd-shortcut {
8185
background-color: var(--ast-search-bar-enable-background) !important;
8286
box-shadow: none !important;
83-
height: 2.25rem; /* 36px */
84-
display: flex;
85-
flex-wrap: wrap;
86-
align-content: center;
8787
}
8888

8989
/* Index Select Dropdown */
@@ -149,21 +149,55 @@ html[data-theme="light"] .highlight {
149149
}
150150

151151
/* Responsive Styles */
152-
@media (max-width: 48rem) { /* 768px */
153-
.bd-search input.expanded {
154-
width: 6.25rem; /* 100px */
152+
@media (min-width: 1200px) and (max-width: 85.375rem) {
153+
.bd-search input.form-control.expanded {
154+
width: 100%; /* 320px */
155+
}
156+
157+
.bd-search input.form-control {
158+
width: 100%; /* 240px */
159+
}
160+
161+
.bd-search .search-button__kbd-shortcut {
162+
display: none !important;
163+
}
164+
165+
.static-search-results {
166+
width: 50%; /* 480px */
167+
}
168+
}
169+
170+
@media (max-width: 1200px) {
171+
172+
.bd-search input.form-control.expanded {
173+
width: 5rem; /* 320px */
155174
}
156175

157-
.form-control {
158-
width: 3.125rem; /* 50px */
176+
.bd-search input.form-control {
177+
width: 100%; /* 240px */
159178
}
160179

161-
.result {
162-
width: 6.25rem; /* 100px */
180+
.static-search-results {
181+
width: 50%; /* 480px */
163182
}
164183

165184
.bd-search .search-button__kbd-shortcut {
166-
display: none;
185+
display: none !important;
186+
}
187+
}
188+
189+
// laptop
190+
@media (min-width: 85.375rem) and (max-width: 128rem) {
191+
.bd-search input.form-control.expanded {
192+
width: 35rem; /* 560px */
193+
}
194+
195+
.bd-search input.form-control {
196+
width: 100%; /* 240px */
197+
}
198+
199+
.static-search-results {
200+
width: 37rem; /* 600px */
167201
}
168202
}
169203

src/ansys_sphinx_theme/assets/styles/pydata-sphinx-theme-custom.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,25 +744,25 @@ button.btn.version-switcher__button:hover {
744744
max-width: 100%;
745745
}
746746

747-
@media (min-width: 960px) {
747+
@media (min-width: 1200px) {
748748
.bd-sidebar-primary {
749749
width: 20%;
750750
}
751751
}
752752

753-
@media (min-width: 960px) {
753+
@media (min-width: 1200px) {
754754
.col-lg-3 {
755755
width: fit-content;
756756
}
757757
}
758758

759-
@media (min-width: 960px) {
759+
@media (min-width: 1200px) {
760760
.bd-page-width {
761761
max-width: min(100%, 1700px) !important;
762762
}
763763
}
764764

765-
@media (min-width: 960px) {
765+
@media (min-width: 1200px) {
766766
.bd-main .bd-content .bd-article-container {
767767
width: min(100%, 1070px);
768768
}

0 commit comments

Comments
 (0)