From ed3b8e8d620405cd813c08ddd73cecd645d67f09 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 Apr 2013 17:41:19 +0100 Subject: Add a proper attributes value for HTML elements --- lib/styles.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/styles.js') diff --git a/lib/styles.js b/lib/styles.js index cbe36d4..737bdcb 100644 --- a/lib/styles.js +++ b/lib/styles.js @@ -4,8 +4,8 @@ exports.topLevelElement = topLevelElement; exports.elements = elements; exports.element = element; -function topLevelElement(tagName) { - return elements([element(tagName, {fresh: true})]); +function topLevelElement(tagName, attributes) { + return elements([element(tagName, attributes, {fresh: true})]); } function elements(elementStyles) { @@ -18,12 +18,11 @@ function elements(elementStyles) { }); } -function element(tagName, options) { +function element(tagName, attributes, options) { options = options || {}; return { tagName: tagName, - fresh: options.fresh, - "class": options["class"], - href: options.href + attributes: attributes || {}, + fresh: options.fresh }; } -- cgit v1.2.3