Skip to content

Commit

Permalink
Added removeOverride() in rendition.themes to remove a css property i…
Browse files Browse the repository at this point in the history
…n rendition.themes._overrides
  • Loading branch information
Nicolas Segarra committed Aug 16, 2019
1 parent d9c2559 commit 0acc423
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ class Contents {

if (value) {
content.style.setProperty(property, value, priority ? "important" : "");
} else {
content.style.removeProperty(property);
}

return this.window.getComputedStyle(content)[property];
Expand Down
10 changes: 10 additions & 0 deletions src/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ class Themes {
});
}

removeOverride (name) {
var contents = this.rendition.getContents();

delete this._overrides[name];

contents.forEach( (content) => {
content.css(name);
});
}

/**
* Add all overrides
* @param {Content} content
Expand Down

0 comments on commit 0acc423

Please sign in to comment.