Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions jss.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ var jss = (function() {

function setStyleProperties(rule, properties) {
for (var key in properties) {
var value = properties[key];
var value = properties[key] || '';
value = value.toString();
var importantIndex = value.indexOf(' !important');

// Modern browsers seem to handle overrides fine, but IE9 doesn't
Expand Down Expand Up @@ -211,7 +212,7 @@ var jss = (function() {

var Jss = function(doc) {
this.doc = doc;
this.head = this.doc.head || this.doc.getElementsByTagName('head')[0];
this.body = this.doc.body || this.doc.getElementsByTagName('body')[0];
this.sheets = this.doc.styleSheets || [];
};

Expand Down Expand Up @@ -271,7 +272,7 @@ var jss = (function() {
var styleNode = this.doc.createElement('style');
styleNode.type = 'text/css';
styleNode.rel = 'stylesheet';
this.head.appendChild(styleNode);
this.body.appendChild(styleNode);
return styleNode.sheet;
},
_removeSheet: function(sheet) {
Expand Down