Skip to content

Commit e906172

Browse files
YacoubBelaouraaocneanu
authored andcommitted
Enso RTL support V3 (#212)
* ✨ RTL V3 * ♻️ clean rtl - remove vue-styled-component - update bulma-rtl patch-file * add rtl themes to themes.php * remove isRTL preference
1 parent de85d79 commit e906172

File tree

5 files changed

+137
-2
lines changed

5 files changed

+137
-2
lines changed

config/enso/themes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
return [
44
'light' => '/themes/light/bulma.min.css',
55
'dark' => '/themes/dark/bulma.min.css',
6+
'light-rtl' => '/themes-rtl/light/bulma.min.css',
7+
'dark-rtl' => '/themes-rtl/dark/bulma.min.css',
68
];

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"animate.css": "^3.6.1",
6060
"axios": "^0.18",
6161
"bulma": "^0.7.2",
62+
"bulma-rtl": "^0.7.1",
6263
"opencollective": "^1.0.3",
6364
"opencollective-postinstall": "^2.0.0",
6465
"patch-package": "^6.0.2",
@@ -75,4 +76,4 @@
7576
"type": "opencollective",
7677
"url": "https://opencollective.com/Enso"
7778
}
78-
}
79+
}

patches/bulma-rtl+0.7.1.patch

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
diff --git a/node_modules/bulma-rtl/sass/base/helpers.sass b/node_modules/bulma-rtl/sass/base/helpers.sass
2+
index 32cafa4..4d9a938 100644
3+
--- a/node_modules/bulma-rtl/sass/base/helpers.sass
4+
+++ b/node_modules/bulma-rtl/sass/base/helpers.sass
5+
@@ -4,10 +4,10 @@
6+
+clearfix
7+
8+
.is-pulled-left
9+
- float: left !important
10+
+ float: right !important
11+
12+
.is-pulled-right
13+
- float: right !important
14+
+ float: left !important
15+
16+
// Overflow
17+
18+
@@ -47,7 +47,7 @@
19+
+fullhd
20+
+typography-size('fullhd')
21+
22+
-$alignments: ('centered': 'center', 'justified': 'justify', 'left': 'left', 'right': 'right')
23+
+$alignments: ('centered': 'center', 'justified': 'justify', 'left': 'right', 'right': 'left')
24+
25+
@each $alignment, $text-align in $alignments
26+
.has-text-#{$alignment}
27+
diff --git a/node_modules/bulma-rtl/sass/components/level.sass b/node_modules/bulma-rtl/sass/components/level.sass
28+
index 7872a05..ff29d74 100644
29+
--- a/node_modules/bulma-rtl/sass/components/level.sass
30+
+++ b/node_modules/bulma-rtl/sass/components/level.sass
31+
@@ -2,8 +2,6 @@
32+
+block
33+
align-items: center
34+
justify-content: space-between
35+
- @if ($right == 'left')
36+
- flex-direction: row-reverse
37+
code
38+
border-radius: $radius
39+
img
40+
diff --git a/node_modules/bulma-rtl/sass/components/navbar.sass b/node_modules/bulma-rtl/sass/components/navbar.sass
41+
index cb477f0..2093791 100644
42+
--- a/node_modules/bulma-rtl/sass/components/navbar.sass
43+
+++ b/node_modules/bulma-rtl/sass/components/navbar.sass
44+
@@ -368,10 +368,10 @@ a.navbar-item,
45+
transform: translateY(-5px)
46+
transition-duration: $speed
47+
transition-property: opacity, transform
48+
- &.is-right
49+
+ &.is-left
50+
left: auto
51+
right: 0
52+
- &.is-left
53+
+ &.is-right
54+
right: auto
55+
left: 0
56+
.navbar-divider
57+
diff --git a/node_modules/bulma-rtl/sass/elements/tag.sass b/node_modules/bulma-rtl/sass/elements/tag.sass
58+
index b07363c..74d8043 100644
59+
--- a/node_modules/bulma-rtl/sass/elements/tag.sass
60+
+++ b/node_modules/bulma-rtl/sass/elements/tag.sass
61+
@@ -18,32 +18,33 @@ $tag-delete-margin: 1px !default
62+
margin-bottom: 1rem
63+
&.has-addons
64+
.tag
65+
- margin-right: 0
66+
+ margin-#{$right}: 0
67+
&:not(:first-child)
68+
- border-bottom-left-radius: 0
69+
- border-top-left-radius: 0
70+
+ margin-#{$left}: 0
71+
+ border-bottom-#{$left}-radius: 0
72+
+ border-top-#{$left}-radius: 0
73+
&:not(:last-child)
74+
- border-bottom-right-radius: 0
75+
- border-top-right-radius: 0
76+
+ border-bottom-#{$right}-radius: 0
77+
+ border-top-#{$right}-radius: 0
78+
&.is-centered
79+
justify-content: center
80+
.tag
81+
- margin-right: 0.25rem
82+
- margin-left: 0.25rem
83+
+ margin-#{$right}: 0.25rem
84+
+ margin-#{$left}: 0.25rem
85+
&.is-right
86+
justify-content: flex-end
87+
.tag
88+
&:not(:first-child)
89+
- margin-left: 0.5rem
90+
+ margin-#{$left}: 0.5rem
91+
&:not(:last-child)
92+
- margin-right: 0
93+
+ margin-#{$right}: 0
94+
&.is-left
95+
justify-content: flex-start
96+
.tag
97+
&:not(:first-child)
98+
- margin-left: 0
99+
+ margin-#{$left}: 0
100+
&:not(:last-child)
101+
- margin-right: 0.5rem
102+
+ margin-#{$right}: 0.5rem
103+
104+
.tag:not(body)
105+
align-items: center
106+
@@ -75,17 +76,17 @@ $tag-delete-margin: 1px !default
107+
font-size: $size-medium
108+
.icon
109+
&:first-child:not(:last-child)
110+
- margin-left: -0.375em
111+
- margin-right: 0.1875em
112+
+ margin-#{$left}: -0.375em
113+
+ margin-#{$right}: 0.1875em
114+
&:last-child:not(:first-child)
115+
- margin-left: 0.1875em
116+
- margin-right: -0.375em
117+
+ margin-#{$left}: 0.1875em
118+
+ margin-#{$right}: -0.375em
119+
&:first-child:last-child
120+
- margin-left: -0.375em
121+
- margin-right: -0.375em
122+
+ margin-#{$left}: -0.375em
123+
+ margin-#{$right}: -0.375em
124+
// Modifiers
125+
&.is-delete
126+
- margin-left: $tag-delete-margin
127+
+ margin-#{$left}: $tag-delete-margin
128+
padding: 0
129+
position: relative
130+
width: 2em

resources/preferences.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"toastrPosition": "bottom-right"
99
},
1010
"local": {}
11-
}
11+
}

webpack.mix.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ mix
3434
.sass('resources/sass/enso.scss', 'public/css')
3535
.sass('node_modules/@enso-ui/themes/bulma/light.scss', 'public/themes/light/bulma.min.css')
3636
.sass('node_modules/@enso-ui/themes/bulma/dark.scss', 'public/themes/dark/bulma.min.css')
37+
.sass('node_modules/@enso-ui/themes/bulma/light-rtl.scss', 'public/themes-rtl/light/bulma.min.css')
38+
.sass('node_modules/@enso-ui/themes/bulma/dark-rtl.scss', 'public/themes-rtl/dark/bulma.min.css')
3739
.js('resources/js/enso.js', 'public/js')
3840
.extract([
3941
'@enso-ui/accessories/bulma', '@enso-ui/bulma', '@enso-ui/card/bulma',

0 commit comments

Comments
 (0)