openstax / css-manipulate

Do more with CSS!
https://jsfiddle.net/philschatz/hjk2z4af/
5 stars 0 forks source link

fetch files and inject them #11

Open philschatz opened 6 years ago

philschatz commented 6 years ago

like SVG icon files. They are injected so that they can be colored via CSS.

Example CSS

body { content: fetch-url('./icon.svg'); }

Output when run on an empty HTML file:

<html>
  <body><!-- DEBUG: Transcluded file './icon.svg' -->
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
      <rect x="25" y="25" width="200" height="200" fill="lime" stroke-width="4" stroke="pink" />
    </svg>
  </body>
</html>

Refs https://github.com/Connexions/cnx-easybake/pull/41

Some things to note: