Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Assets: rewrite inlined CSS file

Started by Robin Kählert 6 years ago · 0 replies · 738 views
6 years ago

Hi there,

i want to inline a CSS file which contains relative references to some font files. Side not: i cannot change these relative URLs inside the CSS file.

The problem is if i inline the file with {% do assets.addCss('theme://assets/iconfont/iconfont.css', {'loading': 'inline'}) %} the references are obviously not working anymore.

I saw that the pipeline is able to rewrite URLs in CSS files. But if i activate the pipeline, the CSS file gets bundled and loaded through a link so it is not inlined anymore.

Is there a way to inline the CSS and rewrite the URLs?

Thanks a lot.

Folderstructure of CSS file with fonts

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 6 days ago
0 89 6 days ago
General · by Dima, 1 week ago
1 116 1 week ago
General · by pamtbaau, 2 weeks ago
0 188 2 weeks ago
General · by lynbor, 2 months ago
5 698 4 weeks ago
General · by Andy Miller, 1 month ago
0 419 1 month ago