Skip to content

Commit

Permalink
fix: don't overwrite inline styles when inlining style elements
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Oct 20, 2019
1 parent 9ee5a28 commit 6e1d825
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ const opts = {
function initStyle(selectedEl) {
if (!selectedEl.style) {
let value = selectedEl.styles || '';
selectedEl.props.style = {};
if (!selectedEl.props.style) {
selectedEl.props.style = {};
}
selectedEl.style = new CSSStyleDeclaration(selectedEl);
selectedEl.style.addStyleHandler();
selectedEl.styles = {
Expand Down Expand Up @@ -636,7 +638,10 @@ export function inlineStyles(document) {
parseCustomProperty: false,
});
} catch (parseError) {
// console.warn('Warning: Parse error of styles of <style/> element, skipped. Error details: ' + parseError);
console.warn(
'Warning: Parse error of styles of <style/> element, skipped. Error details: ' +
parseError,
);
continue;
}

Expand Down

0 comments on commit 6e1d825

Please sign in to comment.