1. Go to this page and download the library: Download irmmr/rtlcss library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
irmmr / rtlcss example snippets
use Irmmr\RTLCss\Parser as RTLParser;
use Sabberworm\CSS\Parser;
use Sabberworm\CSS\Parsing\SourceException;
// it's very simple and I know this
$css_content = "div { float: left; }";
// parse css code
$css_parser = new Parser($css_content);
try {
$css_tree = $css_parser->parse();
} catch (SourceException $e) {
// Error occ
return;
}
// create rtlcss parser
$rtlcss = new RTLParser($css_tree);
// parsing css rules and properties
$rtlcss->flip();
// get parsed css code ==> div {float: right;}
echo $css_tree->render();
use Irmmr\RTLCss\Parser as RTLParser;
use Irmmr\RTLCss\Encode;
use Sabberworm\CSS\Parser;
use Sabberworm\CSS\Parsing\SourceException;
$css_content = "
#element {
float: left;
transform: translate3d(-webkit-calc((25%/2) * 10px), 50%, calc(((25%/2) * 10px)));
box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
}
";
// encode css code
$encoder = new Encode($css_content);
$css_content = $encoder->encode();
// parse css code
$css_parser = new Parser($css_content);
try {
$css_tree = $css_parser->parse();
} catch (SourceException $e) {
// Error occ
return;
}
// create rtlcss parser
$rtlcss = new RTLParser($css_tree);
// parsing css rules and properties
$rtlcss->flip();
// get parsed css code
$encoder->setEncoded( $css_tree->render() );
// get final css code
echo $encoder->decode();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.