Skip to content

Commit ff91127

Browse files
authored
Merge pull request #56 from NgArab/master
Adding RTL Styles
2 parents 1d089b7 + 69f6c3e commit ff91127

File tree

15 files changed

+131
-35
lines changed

15 files changed

+131
-35
lines changed

modules/config/webpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ module.exports = function () {
199199
nib(),
200200
function (style) {
201201
style.define('lang', config.lang);
202-
style.define('isRtl', ['ar','fa'].includes(process.env.TUTORIAL_LANG));
202+
style.define('isRTL', ['ar','fa'].includes(process.env.TUTORIAL_LANG));
203203
style.define('env', config.env);
204204
}
205205
]

modules/frontpage/templates/blocks/_frontpage-content/index.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@
116116

117117
&__title
118118
position relative
119-
padding-left 38px
119+
if isRTL
120+
padding-right 38px
121+
else
122+
padding-left 38px
120123
margin-bottom 2px
121124

122125
&:before

modules/styles/blocks/balance/balance.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
font-weight bold
1414

1515
& &__list
16-
padding-left 19px
16+
if isRTL
17+
padding-right 19px
18+
else
19+
padding-left 19px
1720

1821
& li
1922
margin 12px 0

modules/styles/blocks/body/body.styl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ body
88
color color
99
background background
1010
margin 0
11-
if isRtl
12-
background-color green
11+
if isRTL
1312
direction rtl
1413

1514
@media print

modules/styles/blocks/breadcrumbs/breadcrumbs.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
margin 0
1111

1212
&::after
13-
content "→"
13+
if isRTL
14+
content "←"
15+
else
16+
content "→"
1417
font-family "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif
1518

1619
color #a9a9a9

modules/styles/blocks/extract/extract.styl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@
7979
background #f9edbf
8080

8181
&__content
82-
padding-left 20px
82+
if isRTL
83+
padding-right 20px
84+
else
85+
padding-left 20px
8386
padding-right 10px
8487

8588
&__aside_price

modules/styles/blocks/lessons-list/lessons-list.styl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ lessons-list-separator = 1px solid #ede8e0
5353

5454
&__lesson_level_1
5555
background #faf8f7
56-
padding-left 46px
56+
if isRTL
57+
padding-right 46px
58+
else
59+
padding-left 46px
5760

5861
&__lesson_level_1 > &__link
5962
font-weight 600
@@ -68,7 +71,10 @@ lessons-list-separator = 1px solid #ede8e0
6871

6972
&__lesson_level_2
7073
background #fff
71-
padding-left 71px
74+
if isRTL
75+
padding-right 71px
76+
else
77+
padding-left 71px
7278

7379
&__lesson_level_2:first-child
7480
border-top lessons-list-separator
@@ -176,7 +182,10 @@ lessons-list-separator = 1px solid #ede8e0
176182
width: 21px;
177183
height: 23px;
178184
line-height: 23px;
179-
padding-left: 3px;
185+
if isRTL
186+
padding-right: 3px;
187+
else
188+
padding-left: 3px;
180189

181190
text-align center
182191

modules/styles/blocks/main/main.styl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ $main-loud
7171
border-right 2px solid #f5f2f0
7272

7373
&__lesson-nav-next
74-
padding-left 15px
74+
if isRTL
75+
padding-right 15px
76+
else
77+
padding-left 15px
7578

7679
&__lesson-nav-prev:last-child
7780
border none
@@ -92,7 +95,11 @@ $main-loud
9295

9396
ul,
9497
ol
95-
padding-left 21px
98+
if isRTL
99+
padding-right 21px
100+
101+
else
102+
padding-left 21px
96103
margin 22px 0 // уравниваем с абзацными отступами
97104

98105
> li
@@ -105,8 +112,12 @@ $main-loud
105112

106113
ul > li::before
107114
content "●"
108-
float left // not position: absolute because the latter doesn't show in iBooks (epub)
109-
margin-left -20px
115+
if isRTL
116+
float right
117+
margin-right -20px
118+
else
119+
float left // not position: absolute because the latter doesn't show in iBooks (epub)
120+
margin-left -20px
110121
color #000
111122
font-size 8px
112123

modules/styles/blocks/page-footer/page-footer.styl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323
color light_link_color
2424
background url(slack.svg) left center no-repeat
2525
background-size 16px
26-
padding-left 20px
27-
margin-left -4px
26+
if isRTL
27+
padding-right 20px
28+
margin-right -4px
29+
else
30+
padding-left 20px
31+
margin-left -4px
2832

2933
&__left
3034
flex-grow 1

modules/styles/blocks/page/page.styl

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,26 @@
33
z-index: 0
44
padding 0
55

6+
.sidebar__toggle
7+
if isRTL
8+
left auto
9+
right 100%
610
&_sidebar_on
7-
padding-left sidebar_width
11+
if isRTL
12+
padding-right sidebar_width
13+
else
14+
padding-left sidebar_width
815

916
&__sidebar
1017
position fixed
1118
top 0
1219
bottom 0
13-
left 0
14-
transform translateX(-100%)
20+
if isRTL
21+
right 0
22+
transform translateX(100%)
23+
else
24+
left 0
25+
transform translateX(-100%)
1526

1627
// используется при переключении видимости панели навигации
1728
&__inner
@@ -52,7 +63,10 @@
5263
text-decoration none
5364

5465
&__nav_prev
55-
left 0
66+
if isRTL
67+
right 0
68+
else
69+
left 0
5670
transition transform animation_duration, top animation_duration
5771

5872
&__nav-text
@@ -88,20 +102,29 @@
88102
background rgba(216, 216, 216, .3)
89103

90104
&__nav_prev &__nav-text::before
91-
@extend $font-angle-left
105+
if isRTL
106+
@extend $font-angle-right
107+
else
108+
@extend $font-angle-left
92109

93110
&__nav-text-alternate
94111
display none
95112

96113
&_sidebar_on &__nav_prev
97-
transform translateX(sidebar_width)
114+
if isRTL
115+
transform translateX(- sidebar_width)
116+
else
117+
transform translateX(sidebar_width)
98118

99119
&__nav_next
100-
right 0
120+
left 0
101121
transition top animation_duration
102122

103123
&__nav_next &__nav-text::before
104-
@extend $font-angle-right
124+
if isRTL
125+
@extend $font-angle-left
126+
else
127+
@extend $font-angle-right
105128

106129

107130
&_ebook
@@ -114,7 +137,10 @@
114137
display none
115138

116139
pre.line-numbers
117-
padding-left 10px
140+
if isRTL
141+
padding-right 10px
142+
else
143+
padding-left 10px
118144

119145
// ebook reader has smaller page width,
120146
// so I make sure the code fits it
@@ -196,7 +222,10 @@
196222
border-color: #7e7e7e
197223

198224
&__nav_prev
199-
padding-left 30px
225+
if isRTL
226+
padding-right 30px
227+
else
228+
padding-left 30px
200229

201230
border-right-width 0
202231
border-radius: 6px 0 0 6px

0 commit comments

Comments
 (0)