Skip to content

Converts CSS stylesheets between left-to-right and right-to-left.

License

Notifications You must be signed in to change notification settings

Zysce/cssjanus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSSJanus

Converts CSS stylesheets between left-to-right and right-to-left. This is a C# port for .Net of CSSJanus, which is written in python.

Basic usage

CssJanus cssJanus = new CssJanus();
string rtlCss = cssjanus.Transform( ltrCss );

Advanced usage

Transform( css, swapLtrRtlInUrl, swapLeftRightInUrl )

  • 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

Converts CSS stylesheets between left-to-right and right-to-left.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%