]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - vendor/cssjanus/cssjanus/README.md
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / cssjanus / cssjanus / README.md
1 [![Build Status](https://travis-ci.org/cssjanus/php-cssjanus.svg?branch=master)](https://travis-ci.org/cssjanus/php-cssjanus) [![Packagist](https://img.shields.io/packagist/v/cssjanus/cssjanus.svg?style=flat)](https://packagist.org/packages/cssjanus/cssjanus)
2
3 # CSSJanus
4
5 Convert CSS stylesheets between left-to-right and right-to-left.
6
7 ## Basic usage
8
9 ```php
10 $rtlCss = CSSJanus::transform( $ltrCss );
11 ```
12
13 ## Advanced usage
14
15 ``transform( $css, $swapLtrRtlInURL = false, $swapLeftRightInURL = false )``
16
17 * ``$css`` (string) Stylesheet to transform
18 * ``$swapLtrRtlInURL`` (boolean) Swap 'ltr' and 'rtl' in URLs
19 * ``$swapLeftRightInURL`` (boolean) Swap 'left' and 'right' in URLs
20
21 ### Preventing flipping
22
23 Use a ```/* @noflip */``` comment to protect a rule from being changed.
24
25 ```css
26 .rule1 {
27   /* Will be converted to margin-right */
28   margin-left: 1em;
29 }
30 /* @noflip */
31 .rule2 {
32   /* Will be preserved as margin-left */
33   margin-left: 1em;
34 }
35 ```
36
37 ## Port
38
39 This is a PHP port of the Node.js implementation of CSSJanus.
40
41 Feature requests and bugs related to the actual CSS transformation or test
42 cases of it, should be submitted upstream at
43 <https://github.com/cssjanus/cssjanus>.
44
45 Upstream releases will be ported here.