Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5996185
README.md
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
README.md
View Options
[](https://packagist.org/packages/cssjanus/cssjanus)
#
CSSJanus
Convert
CSS
stylesheets
between
left
-
to
-
right
and
right
-
to
-
left
.
##
Usage
```
php
transform
(
string
$
css
,
bool
$
swapLtrInURL
=
false
,
bool
$
swapLeftInURL
=
false
)
:
string
```
Parameters
;
*
``
$
css
``
(
string
)
Stylesheet
to
transform
.
*
``
$
swapLtrInURL
``
(
boolean
)
Swap
`
ltr
`
to
`
rtl
`
direction
in
URLs
.
*
``
$
swapLeftInURL
``
(
boolean
)
Swap
`
left
`
and
`
right
`
edges
in
URLs
.
Example
:
```
php
$
rtlCss
=
CSSJanus
::
transform
(
$
ltrCss
);
```
###
Preventing
flipping
If
a
rule
is
not
meant
to
be
flipped
by
CSSJanus
,
use
a
`
/* @noflip */
`
comment
to
protect
the
rule
.
```
css
.
rule1
{
/* Will be converted to margin-right */
margin
-
left
:
1
em
;
}
/* @noflip */
.
rule2
{
/* Will be preserved as margin-left */
margin
-
left
:
1
em
;
}
```
##
Port
This
is
a
PHP
port
of
the
Node
.
js
implementation
of
CSSJanus
.
Feature
requests
and
bugs
related
to
the
actual
CSS
transformation
logic
or
test
cases
of
it
,
should
be
submitted
upstream
at
<
https
:
//github.com/cssjanus/cssjanus>.
CSSJanus
was
originally
a
[
Google
project
](
http
:
//code.google.com/p/cssjanus/).
##
Contribute
*
Issue
tracker
:
<
https
:
//phabricator.wikimedia.org/tag/cssjanus/>
*
Source
code
:
<
https
:
//gerrit.wikimedia.org/g/mediawiki/libs/php-cssjanus>
*
Submit
patches
via
Gerrit
:
<
https
:
//www.mediawiki.org/wiki/Developer_account>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 4 2026, 04:11 (5 w, 5 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/c8/c9bd99192ce774b84d3f5d45ea91
Default Alt Text
README.md (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment