You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to setup an image asset in my library, that can be used via a tailwind utility class bg-spray1. Having an issue with how to define and export this asset
If I define it as relative/absolute URL no errors but then the class references nothing since the asset isn't properly exported and put in the right place
If I try to import the asset directly inside the tailwind config file, build crashes since it can't read the file (I guess this is because tailwind precomplier runs before/outside vite?)
import spray from '../assets/images/backgrounds/spray1.png?url';
...
backgroundImage: {
spray1: `url("${spray}")`,
},
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to setup an image asset in my library, that can be used via a tailwind utility class
bg-spray1
. Having an issue with how to define and export this assetIf I define it as relative/absolute URL no errors but then the class references nothing since the asset isn't properly exported and put in the right place
If I try to import the asset directly inside the tailwind config file, build crashes since it can't read the file (I guess this is because tailwind precomplier runs before/outside vite?)
Beta Was this translation helpful? Give feedback.
All reactions