Skip to content

Commit 0721107

Browse files
committed
Handle spotlight styling for light and dark themes
1 parent 101643c commit 0721107

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

devdocs-macos/user-scripts/page-search.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,24 @@
121121
styleEl.setAttribute('type', 'text/css');
122122
styleEl.textContent = `
123123
mark.dd-macos-current {
124-
font-size: 2em;
124+
border-width: 2px;
125+
border-style: solid;
126+
padding: 5px;
127+
}
128+
129+
._theme-default mark.dd-macos-current {
130+
border-color: #000;
131+
}
132+
133+
._theme-dark mark {
134+
background-color: #fff;
135+
color: #000;
136+
}
137+
138+
._theme-dark mark.dd-macos-current {
139+
background-color: #000;
140+
border-color: #fff;
141+
color: #fff;
125142
}
126143
`;
127144
document.querySelector('head').appendChild(styleEl);
@@ -164,10 +181,12 @@
164181
if (typeof term !== 'string') {
165182
return false;
166183
}
184+
167185
const searchTerm = term.trim();
168186
if (searchTerm === '') {
169187
return false;
170188
}
189+
171190
if (searchState && searchState.isCurrentTerm(searchTerm)) {
172191
await searchState.spotlightMark();
173192
return true;

0 commit comments

Comments
 (0)