diff --git a/demo/view-timeline-external-css-with-url/asset/green.png b/demo/view-timeline-external-css-with-url/asset/green.png new file mode 100644 index 0000000..8a978f4 Binary files /dev/null and b/demo/view-timeline-external-css-with-url/asset/green.png differ diff --git a/demo/view-timeline-external-css-with-url/asset/red.png b/demo/view-timeline-external-css-with-url/asset/red.png new file mode 100644 index 0000000..3ff5098 Binary files /dev/null and b/demo/view-timeline-external-css-with-url/asset/red.png differ diff --git a/demo/view-timeline-external-css-with-url/index.html b/demo/view-timeline-external-css-with-url/index.html new file mode 100644 index 0000000..76dd058 --- /dev/null +++ b/demo/view-timeline-external-css-with-url/index.html @@ -0,0 +1,13 @@ + + + + + +
+
+
+
+
+
+ + diff --git a/demo/view-timeline-external-css-with-url/styles.css b/demo/view-timeline-external-css-with-url/styles.css new file mode 100644 index 0000000..fab5000 --- /dev/null +++ b/demo/view-timeline-external-css-with-url/styles.css @@ -0,0 +1,48 @@ +#container { + overflow-y: scroll; + height: 300px; + width: 300px; + border: 1px solid black; + timeline-scope: --foo; +} +.big-spacer { + height: 800px; +} +#subject { + background: url(asset/green.png), blue; + height: 100px; + width: 100px; + view-timeline-name: --foo; +} +#box { + position: fixed; + top: 0; + background: url("../view-timeline-external-css-with-url/asset/red.png"), yellow; + width: 50px; + height: 50px; + /* Please don't delete the following comments */ + /* This comment has been added to make sure css parser ignores it */ + /* animation-range: entry 0% 100%; */ + animation: linear anim forwards; + animation-timeline: --foo; +} + +/* Please don't delete the following comments */ +/* This comment has been added to make sure css parser ignores it */ +/* +#box { + position: fixed; + top: 0; + background-color: red; + width: 50px; + height: 50px; + animation-timeline: foo; + animation-range: entry 0% 100%; + animation: linear anim; +} +*/ + +@keyframes anim { + from { top: 0px; left: 0px; } + to { top: 100px; left: 200px; } +} diff --git a/index.html b/index.html index 54985ea..205daf5 100644 --- a/index.html +++ b/index.html @@ -33,6 +33,9 @@
  • demo/view-timeline-external-css
  • +
  • + demo/view-timeline-external-css-with-url +
  • demo/basic/anonymous-scroll-timeline.html
  • diff --git a/src/scroll-timeline-css-parser.js b/src/scroll-timeline-css-parser.js index 7720a09..1f4ada6 100644 --- a/src/scroll-timeline-css-parser.js +++ b/src/scroll-timeline-css-parser.js @@ -83,10 +83,30 @@ export class StyleParser { this.handleScrollTimelineProps(rule, p); } - // If this sheet has no srcURL (like from a