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

Pipeline::cssRewrite() does not rewrite @import 'mystyle.css'; #3749

Closed
pamtbaau opened this issue Sep 15, 2023 · 0 comments
Closed

Pipeline::cssRewrite() does not rewrite @import 'mystyle.css'; #3749

pamtbaau opened this issue Sep 15, 2023 · 0 comments

Comments

@pamtbaau
Copy link
Contributor

pamtbaau commented Sep 15, 2023

When css_pipeline: true and css_rewrite: true, css files will be merged and minified and stored in /assets. Because of their new location, the urls referenced need to be rewritten.

Method Pipeline:cssRewrite() searches for strings like url('mystyle.css') or url(mystyle.css) and when found they will be rewritten into url('/user/themes/mytheme/css/mystyle.css') and url(/user/themes/mytheme/css/mystyle.css).

This will also work for imports like @import url('mystyle.css');.

Issue

However imports using syntax @import 'mystyle.css';, are equally valid, but are not found by the regex used. These import are not rewritten and therefor have an incorrect url. Because of this, the file will not be imported and an error will be thrown in the console of the browser.

A possible solution

See suggested changes in PR #3750

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

2 participants