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

Can't convert background-image url to correct when subdirectories. #5

Open
yat8823jp opened this issue May 23, 2023 · 0 comments
Open

Comments

@yat8823jp
Copy link
Owner

yat8823jp commented May 23, 2023

URL path of background-image described in SCSS is not converted to correct description in dist when using subdirectories.

ex) Subdirectory is /wp/, and image subdirectory is /photo/

image in directory

develop

/wp/wp-content/theme/themrish/assets/images/photo/example.jpg

dist

/wp/wp-content/theme/themrish/dist/assets/images/example.jpg

SCSS

background-image: url( $base-dir + 'assets/images/photo/bg_wrap.jpg' );
or
background-image: url( #{$base-dir}assets/images/photo/example.jpg );

//#{$base-dir} on vite.config.

css

background-image: url(/dist/assets/images/example.jpg);

WordPress image URL(localhost) is //example.com/wp/wp-content/themes/exapmle/dist/example.jpg

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

No branches or pull requests

1 participant