UNPKG
stylon
Version:
latest (0.0.1)
0.0.1
JSON to DOM style attribute
github.com/bredele/stylon
bredele/stylon
stylon
/
index.js
19 lines
(15 loc)
•
265 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** * Return formatted style attribute * from JSON object. * *
@param
{
Object
}
json
*
@return
{
String
} *
@api
public
*/
module
.
exports
=
function
(
json
) {
var
str =
''
;
for
(
var
key
in
json) { str+= key +
':'
+ json[key] +
';'
; }
return
str; };