Skip to content

Commit 4b70752

Browse files
author
Frederic Massart
committed
And on the 1st day the library was created
0 parents  commit 4b70752

File tree

6 files changed

+1439
-0
lines changed

6 files changed

+1439
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
RTLCSS for PHP
2+
--------------
3+
4+
RTLCSS is a framework for converting Left-To-Right (LTR) Cascading Style Sheets(CSS) to Right-To-Left (RTL).
5+
6+
## Usage
7+
8+
### Installation using composer
9+
10+
Add the library to your composer.json
11+
12+
```json
13+
{
14+
"repositories": [{
15+
"type": "vcs",
16+
"url": "https://github.com/moodlehq/rtlcss-php"
17+
}],
18+
"require-dev": {
19+
"moodlehq/rtlcss-php": "*"
20+
}
21+
}
22+
```
23+
24+
### Flipping
25+
26+
```php
27+
$tree = new Sabberworm\CSS\Parser($css);
28+
$rtlcss = new MoodleHQ\RTLCSS\RTLCSS($tree);
29+
$rtlcss->flip();
30+
echo $tree->render();
31+
```
32+
33+
For parsing options and rendering, refer to [Sabeerword/PHP-CSS-Parser](https://github.com/sabberworm/PHP-CSS-Parser).
34+
35+
## About this tool
36+
37+
This tool is very heavily inspired by [MohammaYounes/rtlcss](https://github.com/MohammadYounes/rtlcss), even though at this stage it does not include all of its features. See this library as a partial port of the latter.
38+
39+
## License
40+
41+
Licensed under the [GNU GPL License](http://www.gnu.org/copyleft/gpl.html).

composer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "moodlehq/rtlcss-php",
3+
"type": "library",
4+
"description": "Convert CSS to Right-to-Left (Port of RTLCSS)",
5+
"keywords": ["rtl", "css"],
6+
"license": "GPL-v3",
7+
"minimum-stability": "dev",
8+
"repositories": [{
9+
"type": "vcs",
10+
"url": "https://github.com/moodlehq/PHP-CSS-Parser"
11+
}],
12+
"require": {
13+
"php": ">=5.4",
14+
"sabberworm/php-css-parser": "dev-MOODLE_32_STABLE as 1.0.x-dev"
15+
},
16+
"require-dev": {
17+
"phpunit/phpunit": "*"
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"MoodleHQ\\": "src/MoodleHQ"
22+
}
23+
}
24+
}

phpunit.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
5+
bootstrap="tests/bootstrap.php">
6+
<testsuites>
7+
<testsuite name="Project Test Suite">
8+
<directory>tests/MoodleHQ</directory>
9+
</testsuite>
10+
</testsuites>
11+
</phpunit>

0 commit comments

Comments
 (0)