Skip to content

Commit 9ccdb68

Browse files
committed
docs: prefix -> space
1 parent 95522d2 commit 9ccdb68

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Join the chat at https://gitter.im/css-in-js/cssobj](https://badges.gitter.im/css-in-js/cssobj.svg)](https://gitter.im/css-in-js/cssobj) [![Build Status](https://travis-ci.org/cssobj/cssobj-plugin-localize.svg?branch=master)](https://travis-ci.org/cssobj/cssobj-plugin-localize)
44

5-
Localize class names for cssobj.
5+
Localize class names for cssobj. Put CSS Class names into different name **space**.
66

77
## Install
88

@@ -14,20 +14,15 @@ npm install cssobj/cssobj-plugin-localize
1414

1515
## API
1616

17-
``` javascript
18-
var localize = require('cssobj-plugin-localize')
19-
var loc = localize(prefix, localNames)
20-
```
21-
22-
#### *PARAMS*
17+
### localize(space: boolean|string, localNames: object) -> {selector: function}
2318

24-
#### prefix
19+
#### space
2520

26-
- Type: `String`
21+
- Type: `String` | `Boolean`
2722

2823
- Default: Random String
2924

30-
If pass empty string `''`, will use `''` (empty prefix)
25+
If pass empty string `''`, will use `''` (empty space)
3126

3227
If pass other falsy value, will use default.
3328

@@ -112,13 +107,13 @@ var ret = cssobj({'body .!nav .!item .login': {color: 'red'}}, {
112107

113108
#### - Custom Prefix
114109

115-
You can control the prefix:
110+
You can control the space:
116111

117112
``` javascript
118113
var ret = cssobj({'body .nav .item .login': {color: 'red'}}, {
119-
plugins:[ localize('_your_prefix_') ]
114+
plugins:[ localize('_your_space_') ]
120115
})
121-
// css is => body ._your_prefix_nav ._your_prefix_item ._your_prefix_login {color: red;}
116+
// css is => body ._your_space_nav ._your_space_item ._your_space_login {color: red;}
122117
```
123118

124119

@@ -137,11 +132,11 @@ var ret = cssobj({'body .nav .!item .login': {color: 'red'}}, {
137132

138133
``` javascript
139134
var ret = cssobj({'body .nav .item .login': {color: 'red'}}, {
140-
plugins:[ localize('_prefix_', {nav: '_abc_'}) ]
135+
plugins:[ localize('_space_', {nav: '_abc_'}) ]
141136
})
142137

143-
ret.mapSel('.nav .item .!pushRight') // === ._abc_ ._prefix_item .pushRight
144-
ret.mapSel(':global(.nav .item) .pushRight') // === .nav .item ._prefix_pushRight
145-
ret.mapClass('item nav !pushRight') // === _prefix_item _abc_ pushRight
138+
ret.mapSel('.nav .item .!pushRight') // === ._abc_ ._space_item .pushRight
139+
ret.mapSel(':global(.nav .item) .pushRight') // === .nav .item ._space_pushRight
140+
ret.mapClass('item nav !pushRight') // === _space_item _abc_ pushRight
146141
```
147142

0 commit comments

Comments
 (0)