项目作者: litespeed-js

项目描述 :
Litespeed.js view component that adds RTL or LTR direction to your your text or input elements according to their language
高级语言: JavaScript
项目地址: git://github.com/litespeed-js/ls-view-text-direction.git
创建时间: 2019-08-04T12:57:30Z
项目社区:https://github.com/litespeed-js/ls-view-text-direction

开源协议:MIT License

下载


ls-view-text-direction

npm
npm version
Build Status
Chat With Us

Litespeed.js view component that adds RTL or LTR direction to your your text or input elements according to their language.

Installation

This package is wrapped as a Litespeed.js component. To use it, you need to init a new Litespeed.js project or use an exisiting Litespeed.js project. To learn more about Litespeed.js Javascript web framework got to the official repository.

Install with NPM:

  1. npm install ls-view-text-direction

Install with CDN:

  1. <script src="https://cdn.jsdelivr.net/npm/ls-view-text-direction"></script>

Getting Started

Add the directive data- attribute on your text or input element. The direction of the text will be decided by the first non-special character.

Example with English

  1. <input type="text" value="Hello World!" data-ls-text-direction />

Result:

  1. <input type="text" value="Hello World!" style="direction: ltr; text-align: left;">

Example with Hebrew

  1. <input type="text" value="שלום עולם!" data-ls-text-direction />

Result:

  1. <input type="text" value="שלום עולם!" style="direction: rtl; text-align: right;">

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send us a pull request.

For security issues, please email security@appwrite.io instead of posting a public issue in GitHub.

The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php