We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const { JSDOM } = require("jsdom"); const { window } = new JSDOM(); const div = window.document.createElement('div'); div.style.setProperty('color', 'red', 'important'); assert.equal( div.outerHTML, `<div style="color: red !important;"></div>` ); // fails — equals `<div style="color: red;"></div>` div.style.setProperty('font-size', '20px', 'important'); assert.equal( div.outerHTML, `<div style="color: red !important; font-size: 20px !important;"></div>` ); // fails — equals `<div style="color: red !important; font-size: 20px;"></div>`
The !important priority is added to each style property. In JSDOM, if the final property has !important, it is omitted.
!important
https://jsbin.com/liquwabetu/edit?html,output
The text was updated successfully, but these errors were encountered:
I think this is actually a bug in cssstyle since jsdom just source the whole CSSStyleDeclaration from there.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Basic info:
Minimal reproduction case
How does similar code behave in browsers?
The
!important
priority is added to each style property. In JSDOM, if the final property has!important
, it is omitted.https://jsbin.com/liquwabetu/edit?html,output
The text was updated successfully, but these errors were encountered: