Skip to content

Commit 801ddf6

Browse files
fix: style for smaller media (#513)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 8673840 commit 801ddf6

File tree

4 files changed

+47
-17
lines changed

4 files changed

+47
-17
lines changed

doc/changelog.d/513.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix: style for smaller media

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/ansys-sphinx-theme-variable.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
--pst-table-font-size: 14px;
5757
--pst-table-header-font-size: 12px;
5858

59+
--pst-sidebar-font-size-mobile: 12px;
60+
--ast-nav-link-font-size: 14px;
61+
5962
/**
6063
* sphinx design font sizes
6164
*/

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/fuse-search.css

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "ansys-sphinx-theme-variable.css";
2+
23
.results {
34
display: flex;
45
flex-direction: column;
@@ -136,24 +137,10 @@ html[data-theme="light"] .highlight {
136137
.bd-search {
137138
gap: 8px;
138139
background-color: var(--ast-search-bar-enable-background);
139-
border: 1px solid var(--ast-search-bar-enable-border);
140+
border: 0px solid var(--ast-search-bar-enable-border);
140141
margin-bottom: 0px;
141142
}
142143

143-
@media (max-width: 768px) {
144-
.form-control:focus,
145-
.form-control:focus-visible,
146-
.form-control {
147-
width: 100px;
148-
}
149-
.bd-search input.expanded {
150-
width: 200px;
151-
}
152-
.bd-search .search-button__kbd-shortcut {
153-
display: none;
154-
}
155-
}
156-
157144
.bd-search input.expanded {
158145
width: 600px;
159146
}
@@ -166,3 +153,21 @@ html[data-theme="light"] .highlight {
166153
opacity: 0.5;
167154
transition: opacity 0.3s ease;
168155
}
156+
157+
@media (max-width: 768px) {
158+
.bd-search input.expanded {
159+
width: 100px;
160+
}
161+
162+
.form-control {
163+
width: 50px;
164+
}
165+
166+
.result {
167+
width: 100px;
168+
}
169+
170+
.bd-search .search-button__kbd-shortcut {
171+
display: none;
172+
}
173+
}

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/pydata-sphinx-theme-custom.css

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@
2222
margin-top: unset;
2323
}
2424

25+
@media (max-width: 959.98px) {
26+
.bd-sidebar-primary {
27+
flex-grow: 0.75;
28+
height: 100vh;
29+
left: 0;
30+
margin-left: -75%;
31+
max-height: 100vh;
32+
max-width: 350px;
33+
position: fixed;
34+
top: 0;
35+
transition:
36+
visibility 0.2s ease-out,
37+
margin 0.2s ease-out;
38+
visibility: hidden;
39+
width: 75%;
40+
z-index: 1055;
41+
}
42+
}
43+
2544
.sidebar-secondary-item {
2645
border: none;
2746
}
@@ -730,8 +749,10 @@ button.btn.version-switcher__button:hover {
730749
max-width: 100%;
731750
}
732751

733-
.bd-sidebar-primary {
734-
width: 20%;
752+
@media (min-width: 960px) {
753+
.bd-sidebar-primary {
754+
width: 20%;
755+
}
735756
}
736757

737758
@media (min-width: 960px) {

0 commit comments

Comments
 (0)