Skip to content

fix: smaller screen view and search for mobile views #689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
11427c1
fix: search button for field
Revathyvenugopal162 May 9, 2025
18db9c8
feat: search for mobile view
Revathyvenugopal162 May 9, 2025
16da9ed
chore: adding changelog file 689.fixed.md [dependabot-skip]
pyansys-ci-bot May 9, 2025
b881df0
Merge branch 'main' into fix/screen-view
Revathyvenugopal162 May 12, 2025
18fe4ae
fix: add percentage
Revathyvenugopal162 May 12, 2025
ae8fd4d
fix(styles): update the laptop width
Revathyvenugopal162 May 12, 2025
eebe5ae
fix(styles): update the shortcut visisbility
Revathyvenugopal162 May 12, 2025
7fa5225
Merge branch 'main' into fix/screen-view
Revathyvenugopal162 May 12, 2025
8169bf7
fix(js): update the mobile search
Revathyvenugopal162 May 12, 2025
8dfa6b6
Merge branch 'main' into fix/screen-view
Revathyvenugopal162 May 12, 2025
dfe3cbb
fix: media container to 1040
Revathyvenugopal162 May 13, 2025
0e32194
Merge branch 'fix/screen-view' of https://github.com/ansys/ansys-sphi…
Revathyvenugopal162 May 13, 2025
2eacb3e
fix: media sidebar
Revathyvenugopal162 May 13, 2025
af19fd6
feat: add minimum to 1040px
Revathyvenugopal162 May 13, 2025
d2c801b
fix: cleanup
Revathyvenugopal162 May 13, 2025
45acf4a
fix(styles): breakpoint to 1200
Revathyvenugopal162 May 13, 2025
39286b6
Merge branch 'main' into fix/screen-view
Revathyvenugopal162 May 13, 2025
4231698
fix: media sidebar
Revathyvenugopal162 May 13, 2025
170b491
Merge branch 'fix/screen-view' of https://github.com/ansys/ansys-sphi…
Revathyvenugopal162 May 13, 2025
0df0bb5
Merge branch 'main' into fix/screen-view
MaxJPRey May 14, 2025
3ce2acc
feat: add resize window
Revathyvenugopal162 May 16, 2025
0b73fb4
Merge branch 'fix/screen-view' of https://github.com/ansys/ansys-sphi…
Revathyvenugopal162 May 16, 2025
d9c84ef
feat: add container width
Revathyvenugopal162 May 16, 2025
b78aef2
feat: cleanup and docstrings
Revathyvenugopal162 May 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/689.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
smaller screen view and search for mobile views
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

:root {
/** Ansys specific changes to the theme */

/**
* Ansys Font family
*
Expand Down Expand Up @@ -52,6 +51,7 @@
--bs-nav-link-font-size: 0.875rem; /* 14px */
--bs-navbar-color: var(--bs-ast-navbar-color);
--ast-font-sidebar-header: 1rem; /* 16px */

/**
* weight
*/
Expand Down Expand Up @@ -422,3 +422,106 @@ h6 {
h1 {
line-height: 56px;
}


/* Mobile-specific overrides (≤ 1200px) */
@media (max-width: 1200px) {
.navbar-header-items {
display: none !important;
flex-grow: 1 !important;
padding: 0 0 0 0.5rem !important;
}

ul.navbar-nav {
align-items: baseline;
}

.navbar-center-items .navbar-item {
display: inline-block;
}

.navbar-persistent--mobile {
display: none;
}

.navbar-persistent--container {
display: flex;
}

.bd-sidebar-primary {
flex-grow: 0.75;
height: 100vh;
left: 0;
margin-left: -75%;
max-height: 100vh !important;
max-width: 350px !important;
position: fixed;
top: 0;
transition: visibility 0.2s ease-out,margin 0.2s ease-out;
visibility: hidden;
width: 75%;
z-index: 1050;
display: flex !important;
}

.bd-sidebar-primary[open] {
visibility: visible !important;
}

button.primary-toggle {
display: flex !important;
}

#pst-collapse-sidebar-button {
display: none !important;
}

nav.bd-links {
display: block !important;
}

.nav-link .hide-on-wide {
display: none !important;
}

.bd-sidebar-primary.hide-on-wide {
display: flex !important;
}

.bd-sidebar-primary .sidebar-header-items {
display: flex !important;
}
}

/* Desktop-specific overrides (> 1200px) */
@media (min-width: 1200px) {
.navbar-header-items {
display: inherit;
flex-grow: 1;
padding: 0 0 0 0.5rem;
}

ul.navbar-nav {
align-items: baseline;
}

.navbar-center-items .navbar-item {
display: inline-block;
}

.navbar-persistent--mobile {
display: none;
}

.navbar-persistent--container {
display: flex;
}

.bd-sidebar-primary {
font-size: var(--pst-sidebar-font-size);
}

button.primary-toggle {
display: none;
}
}
58 changes: 46 additions & 12 deletions src/ansys_sphinx_theme/assets/styles/ast-search.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* Static Search Results Container */

.bd-search{
display: flex;
}
.static-search-results {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -81,10 +85,6 @@ html[data-theme="light"] .highlight {
.bd-search .search-button__kbd-shortcut {
background-color: var(--ast-search-bar-enable-background) !important;
box-shadow: none !important;
height: 2.25rem; /* 36px */
display: flex;
flex-wrap: wrap;
align-content: center;
}

/* Index Select Dropdown */
Expand Down Expand Up @@ -150,20 +150,54 @@ html[data-theme="light"] .highlight {
}

/* Responsive Styles */
@media (max-width: 48rem) { /* 768px */
.bd-search input.expanded {
width: 6.25rem; /* 100px */
@media (min-width: 1200px) and (max-width: 85.375rem) {
.bd-search input.form-control.expanded {
width: 100%; /* 320px */
}

.bd-search input.form-control {
width: 100%; /* 240px */
}

.bd-search .search-button__kbd-shortcut {
display: none !important;
}

.static-search-results {
width: 50%; /* 480px */
}
}

@media (max-width: 1200px) {

.bd-search input.form-control.expanded {
width: 5rem; /* 320px */
}

.form-control {
width: 3.125rem; /* 50px */
.bd-search input.form-control {
width: 100%; /* 240px */
}

.result {
width: 6.25rem; /* 100px */
.static-search-results {
width: 50%; /* 480px */
}

.bd-search .search-button__kbd-shortcut {
display: none;
display: none !important;
}
}

// laptop
@media (min-width: 85.375rem) and (max-width: 128rem) {
.bd-search input.form-control.expanded {
width: 35rem; /* 560px */
}

.bd-search input.form-control {
width: 100%; /* 240px */
}

.static-search-results {
width: 37rem; /* 600px */
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -744,25 +744,25 @@ button.btn.version-switcher__button:hover {
max-width: 100%;
}

@media (min-width: 960px) {
@media (min-width: 1200px) {
.bd-sidebar-primary {
width: 20%;
}
}

@media (min-width: 960px) {
@media (min-width: 1200px) {
.col-lg-3 {
width: fit-content;
}
}

@media (min-width: 960px) {
@media (min-width: 1200px) {
.bd-page-width {
max-width: min(100%, 1700px) !important;
}
}

@media (min-width: 960px) {
@media (min-width: 1200px) {
.bd-main .bd-content .bd-article-container {
width: min(100%, 1070px);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="search-bar pst-js-only" id="search-bar">
<div class="search-bar" id="search-bar">
<form class="bd-search d-flex align-items-center" action="{{ pathto('search') }}" method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search" class="form-control" name="q" placeholder="{{ theme_search_bar_text }}"
Expand Down
Loading
Loading