Skip to content
/ rtlthis Public

Automatically detect and decorate all RTL language script to easily set fonts and language direction.

License

Notifications You must be signed in to change notification settings

jawish/rtlthis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rtlThis

Automatically detect and decorate all RTL language script to easily set fonts and language direction.

Installation

  1. Add the script to the page.
<script src="rtlthis.js"></script>
  1. Run the script on desired elements using the .run(queryOrElem) method.
<script type="text/javascript">
rtlThis.run('body');
</script>
  1. Setup the CSS. rtlThis will add the desired class to the decorating tag when run. This can be then targetted with CSS for setting font, text direction and other settings.

Example to style Dhivehi and Arabic text:

[class*="rtl-"] {
	direction: rtl;
	unicode-bidi: inherit;
}
.rtl-div {
	font-family: 'MV Faseyha';
	font-size: 18px;
}
.rtl-ara {
	font-family: 'Arial MS Unicode','Simplified Arabic', 'Andale sans';
	font-size: 18px;
}

About

Automatically detect and decorate all RTL language script to easily set fonts and language direction.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published