Skip to content

Commit 8e9882d

Browse files
committed
Add css classes
1 parent def144c commit 8e9882d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/librustdoc/html/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ fn render_attributes_in_pre(w: &mut Buffer, it: &clean::Item, prefix: &str) {
10301030
// a div to produce a newline after it.
10311031
fn render_attributes_in_code(w: &mut Buffer, it: &clean::Item) {
10321032
for a in attributes(it) {
1033-
write!(w, "<div>{}</div>", a);
1033+
write!(w, "<div class=\"code-attribute\">{}</div>", a);
10341034
}
10351035
}
10361036

src/librustdoc/html/render/print_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn should_hide_fields(n_fields: usize) -> bool {
140140
fn toggle_open(w: &mut Buffer, text: &str) {
141141
write!(
142142
w,
143-
"<details class=\"type-contents-toggle\"><summary class=\"hideme\"><span>Show {}</span></summary>",
143+
"<details class=\"rustdoc-toggle type-contents-toggle\"><summary class=\"hideme\"><span>Show {}</span></summary>",
144144
text
145145
);
146146
}

src/librustdoc/html/static/rustdoc.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,32 +1756,32 @@ div.name.expand::before {
17561756
/* The hideme class is used on summary tags that contain a span with
17571757
placeholder text shown only when the toggle is closed. For instance,
17581758
"Expand description" or "Show methods". */
1759-
details > summary.hideme {
1759+
details.rustdoc-toggle > summary.hideme {
17601760
cursor: pointer;
17611761
}
17621762

1763-
details > summary::-webkit-details-marker {
1763+
details.rustdoc-toggle > summary::-webkit-details-marker {
17641764
display: none;
17651765
}
17661766

1767-
details > summary.hideme > span {
1767+
details.rustdoc-toggle > summary.hideme > span {
17681768
margin-left: 9px;
17691769
color: #999;
17701770
}
17711771

1772-
details > summary::before {
1772+
details.rustdoc-toggle > summary::before {
17731773
content: "[+]";
17741774
font-weight: 300;
17751775
font-size: 0.8em;
17761776
color: #999;
17771777
letter-spacing: 1px;
17781778
}
17791779

1780-
details > summary.hideme::before {
1780+
details.rustdoc-toggle > summary.hideme::before {
17811781
position: relative;
17821782
}
17831783

1784-
details > summary:not(.hideme)::before {
1784+
details.rustdoc-toggle > summary:not(.hideme)::before {
17851785
float: left;
17861786
}
17871787

@@ -1790,19 +1790,19 @@ details > summary:not(.hideme)::before {
17901790
affect the layout of the items to its right. To do that, we use
17911791
absolute positioning. Note that we also set position: relative
17921792
on the parent <details> to make this work properly. */
1793-
details[open] > summary.hideme {
1793+
details.rustdoc-toggle[open] > summary.hideme {
17941794
position: absolute;
17951795
}
17961796

1797-
details[open] {
1797+
details.rustdoc-toggle[open] {
17981798
position: relative;
17991799
}
18001800

1801-
details[open] > summary.hideme > span {
1801+
details.rustdoc-toggle[open] > summary.hideme > span {
18021802
display: none;
18031803
}
18041804

1805-
details[open] > summary::before {
1805+
details.rustdoc-toggle[open] > summary::before {
18061806
content: "[−]";
18071807
display: inline;
18081808
}

0 commit comments

Comments
 (0)