gantry5 icon indicating copy to clipboard operation
gantry5 copied to clipboard

5.5.5 - Relative paths in SCSS are compiled with domain into CSS

Open blizam opened this issue 3 years ago • 4 comments

Example:

SCSS

#g-header { background: url('../../../../uploads/header-backgrounds/image.png'); }

compiles to:

#g-header{background:url('https://www.domain.com../../../../uploads/header-backgrounds/image.png');

.... which obviously won't load correctly

Rolling back to 5.4.37 resolves the issue

blizam avatar Nov 29 '21 05:11 blizam

Are you using WP?

mahagr avatar Nov 29 '21 12:11 mahagr

@mahagr Yes.

blizam avatar Nov 29 '21 15:11 blizam

Generally, I wouldn't use .. in SCSS because the CSS files it creates can be saved into multiple locations. I would just keep all the files relative to the document root.

The reason why I asked about WP is that it always appends the domain.

mahagr avatar Nov 29 '21 19:11 mahagr

but it's not appending the domain in Gantry 5.4.37? Using relative pathing to maintain a separate dev environment and ultimately just to navigate to the main WP uploads folder so the images are accessible from the WP media manager.

I can certainly adjust the pathing in the SCSS to be non-relative but am trying to avoid it...

blizam avatar Nov 29 '21 20:11 blizam