Hi,
this could be asked many times but didn’t find… sorry about that.
I inherited quark theme and in my custom theme want to set background image for a page.
In my theme i have images folder with my xy.jpg image, in my css/custom.css i tried to set:
background-image: url(‘images/xy.jpg’);
background-image: url(‘/images/xy.jpg’);
background-image: url(‘theme://images/xy.jpg’);
background-image: url(‘{{theme://images/xy.jpg}}’);
non of these works. The only one that works is
background-image: url(‘…/images/xy.jpg’);
This must work if /images is on your web root. Eg. if image is at example.com/some/stuff/images/image.jpg and CSS is at example.com/css/path/styles.css, then url('/some/stuff/images/image.jpg') must work
thank you @Karmalakas , but images is in my theme’s path as css too: grav-admin/user/themes/mytheme/images/xy.jpg grav-admin/user/themes/mytheme/css/custom.css
i thought in css something like background-image: url(‘images/xy.jpg’);
should work, but it’s not…
I really doubt any SCSS/SASS compiler supports Twig. And I don’t really see how it would. Unless you’re compiling to CSS on every single page load, so that it could check variables and use them.