stylex icon indicating copy to clipboard operation
stylex copied to clipboard

Referencing static assets

Open hauxir opened this issue 2 months ago • 1 comments

Description

How can i reference static assets within stylex definitions?

Example

I apologize if I overlooked this in the docs, but I didn't seem to find anything regarding injecting static files into style definitions with Stylex. Is there a recommended method for handling such scenarios?

Example:

import exampleImage from "./example.png"

const styles = stylex.create({
    background: {
        backgroundImage: `url(${exampleImage})`, // This is not allowed currently
    },
});

hauxir avatar Apr 15 '24 23:04 hauxir