Skip to content

Commit

Permalink
use specific "background-color" rule instead of "background" combo-ru…
Browse files Browse the repository at this point in the history
…le to prevent CSS rule expansion in adoptedStylesheets
  • Loading branch information
themacguffinman authored and tdumitrescu committed Jun 17, 2022
1 parent 3b2ac99 commit 74dc4c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/browser/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,15 @@ describe(`Simple Component instance`, function () {

context(`when applying override styles`, function () {
it(`appends the overriding styles to the default styles`, async function () {
el.setAttribute(`style-override`, `:host { background: red; }`);
el.setAttribute(`style-override`, `:host { background-color: red; }`);
await nextAnimationFrame();
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background-color: red; }`);
});

it(`it applies the styles even if the component isn't attached to the DOM`, function () {
el = document.createElement(`shadow-dom-app`);
el.setAttribute(`style-override`, `:host { background: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background: red; }`);
el.setAttribute(`style-override`, `:host { background-color: red; }`);
expect(getComponentStylesheetText(el)).to.equal(`:host { color: blue; }:host { background-color: red; }`);
});
});
});
Expand Down

0 comments on commit 74dc4c2

Please sign in to comment.