Skip to content

Commit 5d9e1b6

Browse files
committed
piratify: fix expand and tabs for Pirates RTL matcornic#469
1 parent 56bc99b commit 5d9e1b6

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

layouts/partials/shortcodes/expand.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
{{- if eq (printf "%T" $expanded) "string" }}
77
{{- $expanded = (eq $expanded "true") }}
88
{{- end }}
9-
{{- $direction := T "Reading-direction" | default "ltr" }}
109
{{- with $context }}
1110
{{- $id := partial "make-random-md5.hugo" }}
1211
<div class="expand">
1312
<input type="checkbox" id="expand-{{ $id }}" aria-controls="expandcontent-{{ $id }}" {{ if $expanded }} checked{{ end }}>
1413
<label class="expand-label" for="expand-{{ $id }}" >
1514
<i class="fas fa-chevron-down"></i>
16-
<i class="fas fa-chevron-left expand-rtl direction-{{ $direction }}"></i>
17-
<i class="fas fa-chevron-right expand-ltr direction-{{ $direction }}"></i>
15+
<i class="fas fa-chevron-left expand-rtl"></i>
16+
<i class="fas fa-chevron-right expand-ltr"></i>
1817
{{ $title }}
1918
</label>
2019
<div id="expandcontent-{{ $id }}" class="expand-content">

layouts/partials/shortcodes/tabs.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{{- $context := .context }}
22
{{- $tabs := .tabs | default slice }}
33
{{- $groupid := .groupid | default "default" }}
4-
{{- $direction := T "Reading-direction" | default "ltr" }}
54
{{- with $context }}
65
<div class="tab-panel" data-tab-group="{{ $groupid }}">
76
<div class="tab-nav">
87
{{- range $idx, $tab := $tabs }}
98
<button
109
data-tab-item="{{ .name }}"
11-
class="tab-nav-button direction-{{ $direction }} {{ cond (eq $idx 0) "active" ""}}"
10+
class="tab-nav-button{{ cond (eq $idx 0) " active" ""}}"
1211
onclick="switchTab('{{ $groupid }}','{{ .name }}')"
1312
>
1413
<span>{{ .name }}</span></button>
@@ -18,7 +17,7 @@
1817
{{- range $idx, $tab := $tabs }}
1918
<div
2019
data-tab-item="{{ .name }}"
21-
class="tab-content-text {{ cond (eq $idx 0) "active" ""}}"
20+
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
2221
>
2322
{{ .content | safeHTML }}
2423
</div>

static/css/ie.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#body .tab-nav-button {
4545
margin-left: 4px;
4646
}
47-
#body .tab-nav-button.direction-rtl {
47+
html[dir="rtl"] #body .tab-nav-button {
4848
float: left;
4949
}
5050
#body .tab-nav-button:first-child {

static/css/tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
padding: 6px 12px;
2121
position: relative;
2222
}
23-
#body .tab-nav-button.direction-rtl{
23+
html[dir="rtl"] #body .tab-nav-button{
2424
float: right;
2525
}
2626

static/css/theme.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,8 @@ option {
11181118
}
11191119

11201120
/* turn off unsuitable expander for this reading direction */
1121-
.expand > .expand-label > .expand-rtl.direction-ltr,
1122-
.expand > .expand-label > .expand-ltr.direction-rtl {
1121+
html[dir="ltr"] .expand > .expand-label > .expand-rtl,
1122+
html[dir="rtl"] .expand > .expand-label > .expand-ltr {
11231123
display: none;
11241124
}
11251125

0 commit comments

Comments
 (0)