Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages