@my_module token resolves to absolute path

Created on 27 February 2022, almost 3 years ago
Updated 9 January 2024, 11 months ago

Problem/Motivation

The documentation says

supports tokens for
a theme/module.
...
url(image.jpg) in css will be compiled to
url(modules/custom/my_module/assets/image.jpg);

but in fact, it resolves to

url(/modules/custom/my_module/assets/image.jpg);

This will only work if the site is installed at the root.

Steps to reproduce

in scss, add

background-image: url(../images/logo/logo.svg); 

in libraries.yml, add

theme/sass/style.scss: 
        assets_path: '@mymodule/assets/'

the output is

background-image: url("/modules/custom/mymodule/assets/../images/logo/logo.svg");

Proposed resolution

Generate full urls for the assets ?

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇳🇱Netherlands commonpike

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024