File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ impl Spec {
105
105
}
106
106
format ! (
107
107
"<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>\
109
109
{test_html}\
110
110
</div>\n ",
111
111
rule_id_broken = rule_id. replace( "." , "<wbr>." ) ,
Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ main > .rule {
278
278
max-width : unset;
279
279
justify-self : right;
280
280
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;
281
285
}
282
286
283
287
.rule-link {
@@ -301,6 +305,19 @@ main > .rule {
301
305
width : 20px ;
302
306
}
303
307
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
+
304
321
/* Align rules to various siblings */
305
322
.rule : has (+ p ),
306
323
.rule : has (+ ul ) {
You can’t perform that action at this time.
0 commit comments