1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Merge pull request #971 from strattonpress/master

Added removeOverride() in rendition.themes to remove a css property in rendition.themes._overrides
This commit is contained in:
Fred Chasen 2019-11-07 09:44:04 -08:00 committed by GitHub
commit a6bbf71363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -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];

View file

@ -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