Skip to content

Commit 3b2b956

Browse files
authored
Fix search rendering, exclude SUMMARY from search. (#197)
1 parent 2019f87 commit 3b2b956

2 files changed

Lines changed: 53 additions & 22 deletions

File tree

docs/en/SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
search:
3+
exclude: true
4+
---
5+
16
- Section one
27
- [Section one](section_one/index.md)
38
- [Section one - page two](section_one/page_two.md)

src/beeware_docs_tools/overrides/assets/stylesheets/beeware_theme.css

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ body {
5454
font-family: var(--brand-font);
5555
}
5656

57-
nav.md-tabs, .md-header {
57+
.md-header {
5858
background-color: var(--md-primary-fg-color);
5959
}
6060

61+
/* Resolves header tabs color issue with search overlay */
62+
.md-tabs {
63+
background-color: unset;
64+
}
65+
6166
.md-header__title {
6267
font-size: 1.24rem;
6368
line-height: 3.3rem;
@@ -103,6 +108,7 @@ nav.md-tabs, .md-header {
103108
/* Search */
104109
.md-search {
105110
margin-left: 1rem;
111+
margin-right: 1rem;
106112
}
107113

108114
input.md-search__input,
@@ -126,12 +132,50 @@ input.md-search__input,
126132
height: 2.5rem;
127133
}
128134

135+
input.md-search__input, .md-search__suggest, .md-search-result__meta {
136+
font-family: var(--brand-font);
137+
}
138+
139+
.md-search__suggest {
140+
padding-top: 1px;
141+
}
142+
143+
.md-search-result .md-typeset h1 {
144+
font-size: 1.6rem;
145+
}
146+
147+
.md-search-result .md-typeset h2,
148+
.md-search-result .md-typeset {
149+
font-size: 1rem;
150+
}
151+
152+
/* The widths in the rest of this section are to correct rendering of the search input */
129153
@media screen and (min-width: 60em) {
130-
.md-search__inner {
131-
width: unset;
132-
}
154+
.md-search {
155+
max-width: 30rem;
156+
width: 100%;
157+
}
158+
}
159+
160+
@media screen and (min-width: 60em) and (max-width: 76.2344em) {
161+
.md-search__scrollwrap,
162+
[data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
163+
width: 100%;
164+
}
133165
}
134166

167+
@media screen and (min-width: 76.25em) {
168+
.md-search__scrollwrap,
169+
[data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
170+
width: 100%;
171+
}
172+
}
173+
174+
.md-search__inner {
175+
width: 100%;
176+
}
177+
178+
135179
/* Link colors */
136180
/* Remove link color from section headers that are not links */
137181
.md-nav__link[for]:focus,
@@ -587,24 +631,6 @@ svg.copy-icon {
587631
padding-left: 8px;
588632
}
589633

590-
/* Search */
591-
input.md-search__input, .md-search__suggest, .md-search-result__meta {
592-
font-family: var(--brand-font);
593-
}
594-
595-
.md-search__suggest {
596-
padding-top: 1px;
597-
}
598-
599-
.md-search-result .md-typeset h1 {
600-
font-size: 1.6rem;
601-
}
602-
603-
.md-search-result .md-typeset h2,
604-
.md-search-result .md-typeset {
605-
font-size: 1rem;
606-
}
607-
608634
/* Footer and footer navigation color */
609635
.md-footer, .md-footer-meta {
610636
background-color: light-dark(#f5f5f5, #343A40);

0 commit comments

Comments
 (0)