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

Fix url of @import not being rewritten #3750

Merged
merged 1 commit into from Oct 2, 2023
Merged

Fix url of @import not being rewritten #3750

merged 1 commit into from Oct 2, 2023

Conversation

pamtbaau
Copy link
Contributor

@pamtbaau pamtbaau commented Sep 15, 2023

This is a suggested fix for the issue mentioned in issue #3749

In short:

When using css imports using syntax @import 'mystyle.css'; the url is not being rewritten.

This PR:

  • adapts the regex used to include above syntax.
  • adapts method Pipeline::cssRewrite() to the newly added matches found by the regex.

Tests

The code has been tested on the following use-cases in /user/themes/quark/css/custom.css:

@import 'import-using-string.css';
@import url('import-using-url.css');

h3 {
    background-image: url('../assets/background-url-quotes.png');
    background-image: url(../assets/background-url-noquotes.png);
}

All urls are correctly rewritten.

@rhukster rhukster merged commit 3cdbc58 into getgrav:develop Oct 2, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants