Skip to content

Commit

Permalink
Merge pull request #310 from jonathanhefner/search-code-elements-like…
Browse files Browse the repository at this point in the history
…-content

Add padding to `<code>` elements in search results
  • Loading branch information
jonathanhefner authored Sep 28, 2023
2 parents 0504c46 + c1acbc8 commit e1ee27c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/rdoc/generator/template/rails/resources/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -646,20 +646,21 @@ html {
font-style: italic;
}

.description :is(code, pre) {
.description pre {
background: var(--code-bg);
}

:is(.description p, p.description) code {
background: var(--code-bg);
padding: 0 0.15em;
border-radius: 2px;
}

/* TODO: Remove this hack when Firefox supports `:has()` */
.description a code {
text-decoration: underline var(--code-bg);
}

.description p code {
padding: 0 0.15em;
border-radius: 2px;
}

@media (hover: hover) {
.description a:hover code {
box-shadow: 0 0 0 1px;
Expand Down

0 comments on commit e1ee27c

Please sign in to comment.