avif-in-css icon indicating copy to clipboard operation
avif-in-css copied to clipboard

AddClass doesn't handle case of class already starting with "body"

Open dmnsgn opened this issue 4 years ago • 0 comments

Source code only handles html:

https://github.com/nucliweb/avif-in-css/blob/13b02388957f1ff649de318d77017cdef7c8ba52/index.js#L14-L16

The following:

body main {
  background-image: url(./assets/test.jpeg);
  background-size: contain;
}

will generate:

body.avif body main {
  background-image: url(/assets/test.0e61a19d72e86eea12e0.avif);
}

Same as in https://github.com/ai/webp-in-css/issues/30

dmnsgn avatar Jan 07 '21 17:01 dmnsgn