-
Notifications
You must be signed in to change notification settings - Fork 2
/
rtlcss.js
54 lines (54 loc) · 1.29 KB
/
rtlcss.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// https://github.com/MohammadYounes/grunt-rtlcss
module.exports = {
build: {
options: {
map: "<%= developmentBuild %>",
clean: true,
plugins: [
{
name: "swap-dashicons-left-right-arrows",
priority: 10,
directives: {
control: {},
value: [],
},
processors: [
{
expr: /content/im,
action: function( prop, value ) {
// For dashicons-arrow-left.
if ( value === '"\\f141"' ) {
value = '"\\f139"';
// For dashicons-arrow-left-alt.
} else if ( value === '"\\f340"' ) {
value = '"\\f344"';
// For dashicons-arrow-left-alt2.
} else if ( value === '"\\f341"' ) {
value = '"\\f345"';
// For dashicons-arrow-right.
} else if ( value === '"\\f139"' ) {
value = '"\\f141"';
// For dashicons-arrow-right-alt.
} else if ( value === '"\\f344"' ) {
value = '"\\f340"';
// For dashicons-arrow-right-alt2.
} else if ( value === '"\\f345"' ) {
value = '"\\f341"';
}
return { prop: prop, value: value };
},
},
],
},
],
},
expand: true,
cwd: "<%= paths.css %>",
src: [
"**/*.css",
"!**/*-rtl.css",
],
dest: "<%= paths.css %>",
ext: "-rtl.css",
},
};