Skip to content

Commit e143490

Browse files
committed
fix(direction): fix style of rtl direction
1 parent 60c830b commit e143490

File tree

5 files changed

+92
-4
lines changed

5 files changed

+92
-4
lines changed

_includes/topbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- The Top Bar -->
22

3-
<header dir={{ site.direction | default: ltr }} id="topbar-wrapper" aria-label="Top Bar">
3+
<header id="topbar-wrapper" aria-label="Top Bar">
44
<div
55
id="topbar"
66
class="d-flex align-items-center justify-content-between px-lg-3 h-100"

_layouts/archives.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@
2323

2424
<li>
2525
{% assign ts = post.date | date: '%s' %}
26-
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
26+
{% if site.direction != "rtl" %}
27+
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
28+
{% endif %}
2729
<span class="date month small text-muted ms-1" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
2830
{{ post.date | date: df_strftime_m }}
2931
</span>
32+
{% if site.direction == "rtl" %}
33+
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
34+
{% endif %}
3035
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
3136
</li>
3237

_layouts/home.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,20 @@ <h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1>
8585
<div class="post-meta flex-grow-1 d-flex align-items-end">
8686
<div class="me-auto">
8787
<!-- posted date -->
88-
<i class="far fa-calendar fa-fw me-1"></i>
88+
{% if site.direction == "rtl" %}
89+
<i class="far fa-folder-open fa-fw me-1"></i>
90+
{% else %}
91+
<i class="far fa-calendar fa-fw me-1"></i>
92+
{% endif %}
8993
{% include datetime.html date=post.date lang=lang %}
9094

9195
<!-- categories -->
9296
{% if post.categories.size > 0 %}
93-
<i class="far fa-folder-open fa-fw me-1"></i>
97+
{% if site.direction == "rtl" %}
98+
<i class="far fa-calendar fa-fw me-1"></i>
99+
{% else %}
100+
<i class="far fa-folder-open fa-fw me-1"></i>
101+
{% endif %}
94102
<span class="categories">
95103
{% for category in post.categories %}
96104
{{ category }}

_sass/base/_syntax.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ div[class^='language-'] {
111111
@extend %code-snippet-bg;
112112

113113
box-shadow: var(--language-border-color) 0 0 0 1px;
114+
direction: ltr;
114115

115116
.content > & {
116117
@include mx.ml-mr(-1rem);

assets/css/jekyll-theme-chirpy.scss

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,78 @@
77
{%- endif -%}
88
';
99

10+
{% if site.direction == "rtl" %}
11+
.nav {
12+
padding: 0px;
13+
}
14+
15+
#sidebar .sidebar-bottom a:not(:last-child) {
16+
margin-left: .8rem;
17+
margin-right: 0px;
18+
}
19+
20+
.me-auto {
21+
margin-left: auto !important;
22+
margin-right: 0px !important;
23+
}
24+
25+
.fa, .fa-brands, .fa-regular, .fa-solid, .fab, .far, .fas {
26+
display: inline;
27+
}
28+
29+
.me-1 {
30+
margin-left: .25rem !important;
31+
}
32+
33+
@media (min-width: 768px) {
34+
#post-list .card .card-body .post-meta i:not(:first-child) {
35+
margin-right: 1.75rem;
36+
}
37+
}
38+
39+
#archives ul li::before, #archives .year:first-child::before, #archives .year::before {
40+
float: right;
41+
}
42+
43+
#archives .year::before {
44+
left: 0px;
45+
right: 79px;
46+
}
47+
48+
#archives .year::after {
49+
left: 0px;
50+
right: 21.5px;
51+
}
52+
53+
#archives ul li::before {
54+
left: 0px;
55+
right: 77px;
56+
}
57+
58+
.list-unstyled {
59+
padding-right: 0;
60+
}
61+
62+
#archives a::before {
63+
float: right;
64+
right: 71px;
65+
left: 0;
66+
}
67+
68+
#archives a {
69+
margin-left: 0;
70+
margin-right: 2.5rem;
71+
}
72+
73+
#archives .date.month {
74+
direction: ltr;
75+
}
76+
77+
{% else %}
78+
body {
79+
direction: ltr;
80+
text-align: left;
81+
}
82+
{% endif %}
83+
1084
/* append your custom style below */

0 commit comments

Comments
 (0)