Skip to content

Commit 336e9f6

Browse files
committed
fixup test links display
it was broken since I changed rule link display, oops.
1 parent 615b4ce commit 336e9f6

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

mdbook-spec/src/rules.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ impl Spec {
8686
let mut test_html = String::new();
8787
if let Some(tests) = tests.get(rule_id) {
8888
test_html = format!(
89-
"<span class=\"popup-container\">\n\
90-
&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:void(0)\" onclick=\"spec_toggle_tests('{rule_id}');\">\
91-
Tests</a>\n\
89+
"<br><span class=\"popup-container\">\n\
90+
<a href=\"javascript:void(0)\" onclick=\"spec_toggle_tests('{rule_id}');\">\
91+
<span>Tests</span></a>\n\
9292
<div id=\"tests-{rule_id}\" class=\"tests-popup popup-hidden\">\n\
9393
Tests with this rule:
9494
<ul>");

theme/reference.css

+19-3
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ main > .rule {
302302
color: #999 !important;
303303
}
304304

305+
/* Test links */
306+
.rule .popup-container {
307+
float: right;
308+
padding-right: 10px;
309+
}
310+
311+
.rule .popup-container > a {
312+
float: right;
313+
text-align: right;
314+
}
315+
305316
/* When clicking a rule, it is added as a URL fragment and the browser will
306317
navigate to it. This adds an indicator that the linked rule is the one that
307318
is "current", just like normal headers are in mdbook.
@@ -326,13 +337,18 @@ main > .rule {
326337
The cutoff point is chosen semi-arbitrary, it felt that
327338
when `width < 14em`, there are too many breaks. */
328339
@container rule (width < 14em) {
329-
main > .rule a span {
340+
main > .rule a.rule-link span,
341+
main > .rule .popup-container > a span {
330342
display: none;
331343
}
332344

333-
main > .rule a::before {
345+
main > .rule > a.rule-link::before {
334346
content: "[*]";
335-
}
347+
}
348+
349+
main > .rule .popup-container > a::before {
350+
content: "[T]";
351+
}
336352
}
337353

338354
/* Align rules to various siblings */

0 commit comments

Comments
 (0)