Skip to content
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

Migrate CSS theme for search results #102547

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
padding-right: 1em;
}

.search-results a:hover,
.search-results a:focus {
background-color: var(--search-result-link-focus-background-color);
}

.popover {
font-size: 1rem;
position: absolute;
Expand Down
25 changes: 1 addition & 24 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
--link-color: #39afd7;
--sidebar-link-color: #53b1db;
--sidebar-current-link-background-color: transparent;
--search-result-link-focus-background-color: #3c3c3c;
--stab-background-color: #314559;
--stab-code-color: #e6e1cf;
}
Expand Down Expand Up @@ -250,30 +251,6 @@ pre.rust .kw {}
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
pre.rust .kw-2, pre.rust .prelude-ty {}

.search-results a:focus span {}
a.result-trait:focus {}
a.result-traitalias:focus {}
a.result-mod:focus,
a.result-externcrate:focus {}
a.result-mod:focus {}
a.result-externcrate:focus {}
a.result-enum:focus {}
a.result-struct:focus {}
a.result-union:focus {}
a.result-fn:focus,
a.result-method:focus,
a.result-tymethod:focus {}
a.result-type:focus {}
a.result-associatedtype:focus {}
a.result-foreigntype:focus {}
a.result-attr:focus,
a.result-derive:focus,
a.result-macro:focus {}
a.result-constant:focus,
a.result-static:focus {}
a.result-primitive:focus {}
a.result-keyword:focus {}

kbd {
color: #c5c5c5;
background-color: #314559;
Expand Down
31 changes: 1 addition & 30 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
--link-color: #d2991d;
--sidebar-link-color: #fdbf35;
--sidebar-current-link-background-color: #444;
--search-result-link-focus-background-color: #616161;
--stab-background-color: #314559;
--stab-code-color: #e6e1cf;
}
Expand All @@ -58,36 +59,6 @@ input:focus + .slider {
background-color: #0a042f !important;
}

.search-results a:hover {
background-color: #777;
}

.search-results a:focus {
color: #eee !important;
background-color: #616161;
}
.search-results a:focus span { color: #eee !important; }
a.result-trait:focus { background-color: #013191; }
a.result-traitalias:focus { background-color: #013191; }
a.result-mod:focus,
a.result-externcrate:focus { background-color: #884719; }
a.result-enum:focus { background-color: #194e9f; }
a.result-struct:focus { background-color: #194e9f; }
a.result-union:focus { background-color: #194e9f; }
a.result-fn:focus,
a.result-method:focus,
a.result-tymethod:focus { background-color: #4950ed; }
a.result-type:focus { background-color: #194e9f; }
a.result-associatedtype:focus { background-color: #884719; }
a.result-foreigntype:focus { background-color: #194e9f; }
a.result-attr:focus,
a.result-derive:focus,
a.result-macro:focus { background-color: #217d1c; }
a.result-constant:focus,
a.result-static:focus { background-color: #884719; }
a.result-primitive:focus { background-color: #194e9f; }
a.result-keyword:focus { background-color: #884719; }

.content .item-info::before { color: #ccc; }

pre.rust .comment { color: #8d8d8b; }
Expand Down
31 changes: 1 addition & 30 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
--link-color: #3873ad;
--sidebar-link-color: #356da4;
--sidebar-current-link-background-color: #fff;
--search-result-link-focus-background-color: #ccc;
--stab-background-color: #fff5d6;
--stab-code-color: #000;
}
Expand All @@ -57,36 +58,6 @@ input:focus + .slider {
background-color: #FDFFD3 !important;
}

.search-results a:hover {
background-color: #ddd;
}

.search-results a:focus {
color: #000 !important;
background-color: #ccc;
}
.search-results a:focus span { color: #000 !important; }
a.result-trait:focus { background-color: #c7b6ff; }
a.result-traitalias:focus { background-color: #c7b6ff; }
a.result-mod:focus,
a.result-externcrate:focus { background-color: #afc6e4; }
a.result-enum:focus { background-color: #e7b1a0; }
a.result-struct:focus { background-color: #e7b1a0; }
a.result-union:focus { background-color: #e7b1a0; }
a.result-fn:focus,
a.result-method:focus,
a.result-tymethod:focus { background-color: #c6afb3; }
a.result-type:focus { background-color: #e7b1a0; }
a.result-associatedtype:focus { background-color: #afc6e4; }
a.result-foreigntype:focus { background-color: #e7b1a0; }
a.result-attr:focus,
a.result-derive:focus,
a.result-macro:focus { background-color: #8ce488; }
a.result-constant:focus,
a.result-static:focus { background-color: #afc6e4; }
a.result-primitive:focus { background-color: #e7b1a0; }
a.result-keyword:focus { background-color: #afc6e4; }

.content .item-info::before { color: #ccc; }

body.source .example-wrap pre.rust a {
Expand Down
Loading