Skip to content

Commit 0f8b538

Browse files
committed
fix: Always place the copy icon on the right side on mobile
1 parent 93c9027 commit 0f8b538

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

assets/sass/anchorlink.scss

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
.a-anchorlink {
22
display: flex;
3-
flex-wrap: wrap;
3+
flex-wrap: nowrap;
4+
margin-bottom: 1.2rem;
5+
align-items: center;
6+
column-gap: .8rem;
7+
8+
@media (max-width: #{$breakpoint-md}) {
9+
justify-content: space-between;
10+
}
11+
}
12+
13+
.a-anchorlink > h2 {
14+
margin-bottom: 0;
415
}
516

6-
.a-anchorlink::before {
7-
content: "";
17+
.o-divider {
818
display: block;
919
width: 100%;
1020
margin: 2rem 0;
@@ -21,7 +31,6 @@
2131
height: 3.2rem;
2232
align-items: center;
2333
justify-content: center;
24-
margin-left: .8rem;
2534
border-radius: var(--border-radius-s);
2635
opacity: .8;
2736
text-decoration: none;

assets/sass/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ img {
163163
justify-content: space-between;
164164
flex-flow: wrap;
165165
column-gap: 2rem;
166+
row-gap: 1rem;
166167
margin-bottom: 1.6rem;
167168
align-items: center;
168169

layouts/country/single.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ <h1 data-pagefind-meta="title">{{ .Title }}</h1>
1717
</div>
1818

1919
<div data-pagefind-weight="2">
20-
{{- with .Content -}}
21-
{{ . | replaceRE "(<h[2] id=\"([^\"]+)\".+)(</h[2]+>)" (print `<span class="a-anchorlink">${1}${3}<a href="#${2}" class="a-anchorlink__link" title="` (T "anchorLink.copy") `">` (partial "icon" "link") `</a></span>`) | safeHTML }}
22-
{{- end -}}
20+
{{ partial "content" . }}
2321
</div>
2422
</div>
2523
<div class="o-single__container">

layouts/operator/single.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ <h1 data-pagefind-meta="title">{{ .Title }}</h1>
1616
{{ partial "updateDate.html" . }}
1717
</div>
1818
<div data-pagefind-weight="2.5">
19-
{{- with .Content -}}
20-
{{ . | replaceRE "(<h[2] id=\"([^\"]+)\".+)(</h[2]+>)" (print `<span class="a-anchorlink">${1}${3}<a href="#${2}" class="a-anchorlink__link" title="` (T "copyAnchorLink") `">` (partial "icon" "link") `</a></span>`) | safeHTML }}
21-
{{- end -}}
19+
{{ partial "content" . }}
2220
</div>
2321
</div>
2422
{{ partial "image" (partial "helper/contentImage" . ) }}

layouts/partials/content.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- with .Content -}}
2+
{{ . | replaceRE "(<h[2] id=\"([^\"]+)\".+)(</h[2]+>)" (print `<span class="o-divider"></span><span class="a-anchorlink">${1}${3}<a href="#${2}" class="a-anchorlink__link" title="` (T "anchorLink.copy") `">` (partial "icon" "link") `</a></span>`) | safeHTML }}
3+
{{- end -}}

0 commit comments

Comments
 (0)