diff --git a/mdbook-spec/src/rules.rs b/mdbook-spec/src/rules.rs index dcab26d1b..1b51fe413 100644 --- a/mdbook-spec/src/rules.rs +++ b/mdbook-spec/src/rules.rs @@ -86,9 +86,9 @@ impl Spec { let mut test_html = String::new(); if let Some(tests) = tests.get(rule_id) { test_html = format!( - "\n\ -     \ - Tests\n\ + "
\n\ + \ + Tests\n\
\n\ Tests with this rule:
    "); diff --git a/theme/reference.css b/theme/reference.css index 147e0ed5a..49a3427c7 100644 --- a/theme/reference.css +++ b/theme/reference.css @@ -178,11 +178,11 @@ main { display: grid; grid-template-columns: /* Left margin / place for rules */ - [rules] minmax(20px, 1fr) + [rules] minmax(36px, 1fr) /* The main text body */ [text] auto /* Right margin */ - [margin] minmax(20px, 1fr); + [margin] minmax(36px, 1fr); /* We do these by hand via the grid */ margin: 0; @@ -302,6 +302,17 @@ main > .rule { color: #999 !important; } +/* Test links */ +.rule .popup-container { + float: right; + padding-right: 10px; +} + +.rule .popup-container > a { + float: right; + text-align: right; +} + /* When clicking a rule, it is added as a URL fragment and the browser will navigate to it. This adds an indicator that the linked rule is the one that is "current", just like normal headers are in mdbook. @@ -326,13 +337,18 @@ main > .rule { The cutoff point is chosen semi-arbitrary, it felt that when `width < 14em`, there are too many breaks. */ @container rule (width < 14em) { - main > .rule a span { + main > .rule a.rule-link span, + main > .rule .popup-container > a span { display: none; } - main > .rule a::before { + main > .rule > a.rule-link::before { content: "[*]"; - } + } + + main > .rule .popup-container > a::before { + content: "[T]"; + } } /* Align rules to various siblings */