Skip to content

Commit

Permalink
Merge pull request #335 from jonathanhefner/css-bump-generic-styles
Browse files Browse the repository at this point in the history
Move generic styles higher in the stylesheet
  • Loading branch information
jonathanhefner authored Oct 17, 2023
2 parents f9aa78e + bde27b6 commit 8997512
Showing 1 changed file with 113 additions and 110 deletions.
223 changes: 113 additions & 110 deletions lib/rdoc/generator/template/rails/resources/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,115 @@ th
}


/*
* Generic content
*/

:where(.content) *,
:where(.content) :is(br, wbr) {
margin: 0;
}

:where(.content) * + * {
margin-top: var(--space);
}

:where(.content) :is(ol, ul, dd) {
padding: 0 0 0 1.25em;
}

:where(.content) * + :is(li, dd) {
margin-top: var(--space-sm);
}

/* Increase top margin for list items when any item has more than one paragraph */
:where(.content :is(ol, ul):has(> li > p:not(:only-child))) * + li {
margin-top: var(--space);
}

:where(.content) code {
font-style: normal;
}


/*
* Description section
*/

.description :is(h1, h2, h3, h4, h5, h6) {
line-height: 1.25;
padding: 0.125em 0;
}

.description :not(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) {
margin-top: var(--space-lg);
}

.description h1 {
font-size: 1.6em;
font-weight: bold;
}

.description h2 {
font-size: 1.6em;
font-weight: normal;
}

.description h3 {
font-size: 1.3em;
font-weight: normal;
}

.description h4 {
font-size: 1.2em;
font-weight: normal;
font-style: italic;
}

.description h5 {
font-size: 1.1em;
font-weight: bold;
}

.description h6 {
font-size: 1em;
font-weight: bold;
font-style: italic;
}

.description pre, .method__source pre {
padding: 0.5ch 1ch;
border-radius: 4px;
overflow-x: auto;

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()` */
@supports not selector(:has(*)) {
.description a code {
text-decoration: underline var(--code-bg);
}
}

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

.description dt {
font-weight: bold;
}


/*
* Navigation panel
*/
Expand Down Expand Up @@ -527,32 +636,6 @@ html {
}
}

:where(.content) *,
:where(.content) :is(br, wbr) {
margin: 0;
}

:where(.content) * + * {
margin-top: var(--space);
}

:where(.content) :is(ol, ul, dd) {
padding: 0 0 0 1.25em;
}

:where(.content) * + :is(li, dd) {
margin-top: var(--space-sm);
}

/* Increase top margin for list items when any item has more than one paragraph */
:where(.content :is(ol, ul):has(> li > p:not(:only-child))) * + li {
margin-top: var(--space);
}

:where(.content) code {
font-style: normal;
}

.content__title {
font-size: 1.6em;
line-height: 1.25;
Expand All @@ -572,6 +655,10 @@ html {
margin-top: 0;
}

.content__title ~ #context > .description {
margin-top: var(--space-lg);
}

.content__source-link {
margin-top: var(--space-sm);
}
Expand Down Expand Up @@ -694,90 +781,6 @@ html {
background: var(--source-code-bg);
}

.method__source pre,
.description pre {
padding: 0.5ch 1ch;
border-radius: 4px;
overflow-x: auto;
}


/*
* Description of method or module
*/

.content__title ~ #context > .description {
margin-top: var(--space-lg);
}

.description :is(h1, h2, h3, h4, h5, h6) {
line-height: 1.25;
padding: 0.125em 0;
}

.description :not(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) {
margin-top: var(--space-lg);
}

.description h1 {
font-size: 1.6em;
font-weight: bold;
}

.description h2 {
font-size: 1.6em;
font-weight: normal;
}

.description h3 {
font-size: 1.3em;
font-weight: normal;
}

.description h4 {
font-size: 1.2em;
font-weight: normal;
font-style: italic;
}

.description h5 {
font-size: 1.1em;
font-weight: bold;
}

.description h6 {
font-size: 1em;
font-weight: bold;
font-style: italic;
}

.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()` */
@supports not selector(:has(*)) {
.description a code {
text-decoration: underline var(--code-bg);
}
}

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

.description dt {
font-weight: bold;
}


/*
* More-Less widget
Expand Down

0 comments on commit 8997512

Please sign in to comment.