Fix position of scraped examples title on mobile devices

This commit is contained in:
Guillaume Gomez 2024-09-01 15:00:34 +02:00
parent 84259ff23b
commit 35a7c1b8da
2 changed files with 14 additions and 3 deletions

View File

@ -2267,6 +2267,17 @@ in src-script.js and main.js
margin: 0;
padding: var(--nav-sub-mobile-padding);
}
.example-wrap.scraped-example {
flex-wrap: wrap;
}
.example-wrap .scraped-example-title {
width: 100%;
}
.example-wrap.scraped-example .rust {
/* Dirty hacky to force it to remain on the same line as the line numbers. */
width: 10px;
}
}
/* Should have min-width: (N + 1)px where N is the mobile breakpoint above. */

View File

@ -1,4 +1,7 @@
<div class="example-wrap scraped-example{% if !info.needs_expansion +%} expanded{% endif %}" data-locs="{{info.locations}}">
<div class="scraped-example-title">
{{info.name +}} (<a href="{{info.url}}">{{info.title}}</a>) {# #}
</div>
{# https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#data-nosnippet-attr
Do not show "1 2 3 4 5 ..." in web search results. #}
<div data-nosnippet><pre class="src-line-numbers">
@ -12,9 +15,6 @@
{{code_html|safe}}
</code> {# #}
</pre> {# #}
<div class="scraped-example-title">
{{info.name +}} (<a href="{{info.url}}">{{info.title}}</a>) {# #}
</div>
{% if info.needs_prev_next_buttons || info.needs_expansion %}
<div class="button-holder">
{% if info.needs_prev_next_buttons %}