Skip to content

Commit

Permalink
feat(hiccup-css): add support for iterators as arg type to css()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 5, 2018
1 parent cbb9b7f commit 02bff87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/hiccup-css/src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export function css(rules: any, opts?: Partial<CSSOpts>) {
if (isArray(opts.autoprefix)) {
opts.autoprefix = new Set(opts.autoprefix);
}
if (isIterable(rules) && !isString(rules)) {
rules = [...rules];
}
if (isArray(rules)) {
return _css([], [], rules, <CSSOpts>opts).join(opts.format.rules);
}
Expand Down Expand Up @@ -64,7 +67,7 @@ export function _css(acc: string[], parent: any[], rules: any[], opts: CSSOpts)
}
} else if (isPlainObject(r)) {
curr = Object.assign(curr || {}, r);
} else {
} else if (r != null) {
sel.push(r);
}
}
Expand Down

0 comments on commit 02bff87

Please sign in to comment.