Skip to content

Commit 196e54b

Browse files
Style .description elements
1 parent a67ece6 commit 196e54b

File tree

3 files changed

+66
-57
lines changed

3 files changed

+66
-57
lines changed

lib/rdoc/generator/template/rails/_context.rhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154

155155
<% if method.comment %>
156156
<div class="description">
157-
<%= method.description.strip %>
157+
<%= method.description %>
158158
</div>
159159
<% end %>
160160

lib/rdoc/generator/template/rails/resources/css/main.css

Lines changed: 65 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,6 @@ a:hover {
6262
display: none;
6363
}
6464

65-
h1 {
66-
font-size: 2.1em;
67-
font-weight: normal;
68-
line-height: 1.2em;
69-
}
70-
71-
h2 {
72-
font-size: 1.6em;
73-
font-weight: normal;
74-
line-height: 1.2em;
75-
}
76-
77-
h3 {
78-
font-size: 1.4em;
79-
font-weight: normal;
80-
}
81-
82-
h4 {
83-
font-size: 1em;
84-
}
85-
8665
td, th
8766
{
8867
padding: 0 0.7em 0.3em 0;
@@ -99,18 +78,12 @@ th
9978
width: 0; height: 0;
10079
}
10180

102-
dt
103-
{
104-
font-weight: bold;
105-
}
106-
10781
.methods dt
10882
{
10983
width: 1em;
11084
font-size: 1.5em;
11185
color:#AAA;
11286
position: absolute;
113-
font-weight: normal;
11487
}
11588

11689
.methods dd
@@ -149,26 +122,6 @@ dt
149122
font-size: 1.15em;
150123
}
151124

152-
.description pre {
153-
padding: 1em 1.2em;
154-
background: var(--code-bg);
155-
border-radius: 10px;
156-
}
157-
158-
.description pre,
159-
.method__source pre {
160-
overflow-x: auto;
161-
}
162-
163-
.method h4
164-
{
165-
border-bottom: 1px dotted #999;
166-
padding: 0 0 0.2em 0;
167-
margin-bottom: 0.8em;
168-
font-size: 1.1em;
169-
color: var(--heading-color);
170-
}
171-
172125
@keyframes spotlight {
173126
from { background-color: yellow; }
174127
to { background-color: white; }
@@ -179,13 +132,6 @@ dt
179132
animation-duration: 1s;
180133
}
181134

182-
p code {
183-
background: var(--code-bg);
184-
border-radius: 5px;
185-
margin-bottom: 1px;
186-
padding: 0 5px;
187-
}
188-
189135
.sr-only {
190136
position: absolute;
191137
width: 1px;
@@ -533,10 +479,74 @@ html {
533479

534480
.method__source pre {
535481
margin-top: var(--space-sm);
482+
background: var(--source-code-bg);
483+
}
484+
485+
.method__source pre,
486+
.description pre {
536487
padding: 0.5em 1em;
537488
border-radius: 8px;
489+
overflow-x: auto;
490+
}
538491

539-
background: var(--source-code-bg);
492+
493+
/*
494+
* Description of method or module
495+
*/
496+
497+
.description :is(h1, h2, h3, h4, h5, h6) {
498+
line-height: 1.25;
499+
padding: 0.125em 0;
500+
}
501+
502+
.description :not(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) {
503+
margin-top: var(--space-lg);
504+
}
505+
506+
.description h1 {
507+
font-size: 1.6em;
508+
font-weight: bold;
509+
}
510+
511+
.description h2 {
512+
font-size: 1.6em;
513+
font-weight: normal;
514+
}
515+
516+
.description h3 {
517+
font-size: 1.3em;
518+
font-weight: normal;
519+
}
520+
521+
.description h4 {
522+
font-size: 1.2em;
523+
font-weight: normal;
524+
font-style: italic;
525+
}
526+
527+
.description h5 {
528+
font-size: 1.1em;
529+
font-weight: bold;
530+
}
531+
532+
.description h6 {
533+
font-size: 1em;
534+
font-weight: bold;
535+
font-style: italic;
536+
}
537+
538+
.description pre,
539+
.description p code {
540+
background: var(--code-bg);
541+
}
542+
543+
.description p code {
544+
padding: 0 0.15em;
545+
border-radius: 2px;
546+
}
547+
548+
.description dt {
549+
font-weight: bold;
540550
}
541551

542552

lib/rdoc/generator/template/rails/resources/css/reset.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ b, u, i, center,
1010
dl, dt, dd, ol, ul, li,
1111
fieldset, form, label, legend,
1212
table, caption, tbody, tfoot, thead, tr, th, td {
13-
font-size: 100%;
1413
background: transparent;
1514
}
1615
blockquote, q {

0 commit comments

Comments
 (0)