Skip to content

mattflaschen/php-cssjanus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Latest Stable Version

CSSJanus

Convert CSS stylesheets between left-to-right and right-to-left. This is a PHP port of CSSJanus (written in Python).

Basic usage

$rtlCss = CSSJanus::transform( $ltrCss );

Advanced usage

transform( $css, $swapLtrRtlInURL = false, $swapLeftRightInURL = false )

  • $css (string) Stylesheet to transform
  • $swapLtrRtlInURL (boolean) Swap 'ltr' and 'rtl' in URLs
  • $swapLeftRightInURL (boolean) Swap 'left' and 'right' in URLs

Preventing flipping

Use a /* @noflip */ comment to protect a rule from being changed.

.rule1 {
  /* Will be converted to margin-right */
  margin-left: 1em;
}
/* @noflip */
.rule2 {
  /* Will be preserved as margin-left */
  margin-left: 1em;
}

Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published