1// Create our stylesheet
2var style = document.createElement('style');
3style.innerHTML =
4 '.some-element {' +
5 'color: purple;' +
6 'background-color: #e5e5e5;' +
7 'height: 150px;' +
8 '}';
9
10// Get the first script tag
11var ref = document.querySelector('script');
12
13// Insert our new styles before the first script tag
14ref.parentNode.insertBefore(style, ref);
15
1 const style = document.createElement(`style`);
2 // this.shadowRoot.appendChild(this.templateContent);
3 // log(`this.shadowRoot`, this.shadowRoot);
4 style.setContent = `
5 .run {
6 width: 100px;
7 height: 100px;
8 background: url(https://www.boston.com/wp-content/uploads/2016/05/yuge_anger.png) 0 0;
9 animation: run 500 step(6) infinite;
10 }
11 @keyframes run {
12 from {
13 background-position: 0 0;
14 }
15 to {
16 background-position: -600px 0;
17 }
18 }
19 `;
20
21