Skip to content

Commit 1a9e676

Browse files
committed
refactor: Replace ::before for dividers with explicit hr
1 parent 872e53c commit 1a9e676

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

assets/sass/anchorlink.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
.a-anchorlink {
22
display: flex;
33
flex-wrap: wrap;
4+
margin-bottom: 1.2rem;
5+
align-items: center;
6+
column-gap: .8rem;
7+
}
8+
9+
.a-anchorlink > h2 {
10+
margin-bottom: 0;
411
}
512

6-
.a-anchorlink::before {
7-
content: "";
13+
.o-divider {
814
display: block;
915
width: 100%;
1016
margin: 2rem 0;
@@ -13,6 +19,7 @@
1319
background-repeat: no-repeat;
1420
height: 2.4rem;
1521
opacity: 50%;
22+
border-top: 0;
1623
}
1724

1825
.a-anchorlink__link {
@@ -21,7 +28,6 @@
2128
height: 3.2rem;
2229
align-items: center;
2330
justify-content: center;
24-
margin-left: .8rem;
2531
border-radius: var(--border-radius-s);
2632
opacity: .8;
2733
text-decoration: none;

assets/sass/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ img {
172172
justify-content: space-between;
173173
flex-flow: wrap;
174174
column-gap: 2rem;
175+
row-gap: 1rem;
175176
margin-bottom: 1.6rem;
176177
align-items: center;
177178

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 o-related__operator-wrapper">

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 `<hr class="o-divider"><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)