Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties: separate the background image from its content property #146

Open
Oxalin opened this issue Oct 21, 2024 · 0 comments
Open

Properties: separate the background image from its content property #146

Oxalin opened this issue Oct 21, 2024 · 0 comments

Comments

@Oxalin
Copy link

Oxalin commented Oct 21, 2024

Using Vue et Vite with the site to be hosted in WordPress, I'm having trouble with the dynamic resolution of the final background image (icon-fullscreen.svg). While I'm able to add some cue in .vue and .php files to tell Vite how it should resolve the template's path, I haven't figured out a solution for the .css/.scss file.

Vite resolves the background-image: url value as "/assets/icon-fullscreen_RandomIDofItsLiking_.svg", which points to https://domain/assets/icon-fullscreen_RandomIDofItsLiking_.svg, which is wrong.

My workaround for now is to insert a .fullscreen-icon in my main CSS file to override the background-image url. There may be another way to fix this that I don't know yet.

However, I would still like to suggest to add a new property to set the iconUrl independentrly from the "content" property. Firstly, it would allow to fix the reported problem within the .vue file. Secondly, il would allow to have both a background-image (customized or the default one) and a HTML content over it (whatever the user could want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants