insert styles from component on registration

This commit is contained in:
Keegan
2016-02-09 17:20:44 -08:00
parent 2cba1c9306
commit 8f1ced168f
5 changed files with 95 additions and 26 deletions
+7
View File
@@ -208,6 +208,13 @@ ClayConfig.registerComponent = function(component) {
throw new Error('The manipulator must have both a `get` and `set` method');
}
if (_component.style) {
var style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(_component.style));
document.head.appendChild(style);
}
componentStore[_component.name] = _component;
};