aboutsummaryrefslogtreecommitdiff
path: root/lib/styles.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-04-01 17:41:19 +0100
committerMichael Williamson <mike@zwobble.org>2013-04-01 17:41:19 +0100
commited3b8e8d620405cd813c08ddd73cecd645d67f09 (patch)
treee3f81d8c30a7909ee3d4bf2f520bf3635f5b15c9 /lib/styles.js
parentbd8b2786247308c7bd82dc3cda627a23b4898958 (diff)
Add a proper attributes value for HTML elements
Diffstat (limited to 'lib/styles.js')
-rw-r--r--lib/styles.js11
1 files changed, 5 insertions, 6 deletions
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
};
}