mayu-live / framework

Mayu is a live updating server-side component-based VDOM rendering framework written in Ruby
https://mayu.live
GNU Affero General Public License v3.0
135 stars 4 forks source link

Handle `url()` in CSS files #59

Open aalin opened 1 year ago

aalin commented 1 year ago

The CSS transformer will take:

foo { background-image: url("foobar.png"); }

and turn it into:

.demo_foo\?uc88-KVY { background-image: url("LMXcDq"); }

and also return this dependencies-array:

[
  {
    type: "url",
    url: "foobar.png",
    placeholder: "LMXcDq",
    loc: {
      filePath: "demo.rb",
      start: {
        line: 3,
        column: 25
      },
      end: {
        line: 3,
        column: 34
      }
    }
  }
]

So, somehow images need to be loaded and the placeholders should be replaced with their paths