File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ impl Spec {
105105 }
106106 format ! (
107107 "<div class=\" rule\" id=\" r-{rule_id}\" >\
108- <a class=\" rule-link\" href=\" #r-{rule_id}\" >[{rule_id_broken}]</a>\
108+ <a class=\" rule-link\" href=\" #r-{rule_id}\" ><span> [{rule_id_broken}]<span/> </a>\
109109 {test_html}\
110110 </div>\n ",
111111 rule_id_broken = rule_id. replace( "." , "<wbr>." ) ,
Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ main > .rule {
278278 max-width : unset;
279279 justify-self : right;
280280 width : 100% ;
281+ /* We use a container query to know the size of the "left margin",
282+ so that we can hide rules is there is not enough space. */
283+ container-type : inline-size;
284+ container-name : rule;
281285}
282286
283287.rule-link {
@@ -301,6 +305,19 @@ main > .rule {
301305 width : 20px ;
302306}
303307
308+ /* Hide the rules if the width of the container is too small.
309+ The cutoff point is chosen semi-arbitrary, it felt that
310+ when `width < 14em`, there are too many breaks. */
311+ @container rule (width < 14em) {
312+ main > .rule a span {
313+ display : none;
314+ }
315+
316+ main > .rule a ::before {
317+ content : "[*]" ;
318+ }
319+ }
320+
304321/* Align rules to various siblings */
305322.rule : has (+ p ),
306323.rule : has (+ ul ) {
You can’t perform that action at this time.
0 commit comments