https://github.com/jawish/rtlthis
Automatically detect and decorate all RTL language script to easily set fonts and language direction.
https://github.com/jawish/rtlthis
Last synced: 8 months ago
JSON representation
Automatically detect and decorate all RTL language script to easily set fonts and language direction.
- Host: GitHub
- URL: https://github.com/jawish/rtlthis
- Owner: jawish
- License: mit
- Created: 2015-07-28T10:25:15.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-28T10:40:49.000Z (almost 10 years ago)
- Last Synced: 2024-10-24T03:27:47.002Z (8 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rtlThis
Automatically detect and decorate all RTL language script to easily set fonts and language direction.## Installation
1. Add the script to the page.```html
```
2. Run the script on desired elements using the .run(queryOrElem) method.
```html
rtlThis.run('body');
```
3. 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:
```css
[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;
}
```