one-spaces
Advanced tools
Comparing version 1.1.1 to 1.1.2
/** | ||
* @author TroyTae | ||
* @version 1.1.1 | ||
* @version 1.1.2 | ||
* @name one-spaces | ||
@@ -5,0 +5,0 @@ */ |
{ | ||
"name": "one-spaces", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A tiny(121B) module for making className 😎", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -0,4 +1,5 @@ | ||
[![npm](https://badge.fury.io/js/one-spaces.svg)](https://www.npmjs.com/package/one-spaces) | ||
# One Spaces | ||
A tiny(121B) module for making className 😎 | ||
## Installation | ||
@@ -20,27 +21,36 @@ | ||
### arguments | ||
### VanillaJS | ||
```javascript | ||
OneSpaces('cls1', 'cls2', 'cls3') === 'cls3 cls2 cls1 ' | ||
var el = document.getElementById('my-element'); | ||
// arguments | ||
el.className = OneSpaces('cls1', 'cls2', 'cls3'); | ||
// array | ||
el.className = OneSpaces(['cls1', 'cls2'], ['cls3']); | ||
// exclude falsy | ||
el.className = OneSpaces('cls1', null, 'cls2', false && 'none', true && 'cls3'); | ||
// mix | ||
el.className = OneSpaces(['cls1', 'cls2'], null, 'cls3'); | ||
``` | ||
### array | ||
### React (jsx) | ||
```javascript | ||
OneSpaces(['cls1', 'cls2'], ['cls3']) === 'cls3 cls2 cls1 ' | ||
``` | ||
```jsx | ||
import spaces from 'one-spaces'; | ||
### exclude falsy | ||
```javascript | ||
OneSpaces('cls1', null, 'cls2', false && 'none', true && 'cls3') === 'cls3 cls2 cls1 ' | ||
export default () => { | ||
return ( | ||
<div className={spaces(['cls1', 'cls2'], null, 'cls3')}> | ||
<span>Hello React!</span> | ||
</div> | ||
); | ||
}; | ||
``` | ||
### mix | ||
### Angular & Vue | ||
```javascript | ||
OneSpaces(['cls1', 'cls2'], null, 'cls3') === 'cls3 cls2 cls1 ' | ||
``` | ||
Angular and Vue have their own system for className. | ||
Of course you can use this module with them but not recommended. | ||
## License | ||
MIT © Troy Tae |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9641
56