Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Assets: rewrite inlined CSS file

Started by Robin Kählert 6 years ago · 0 replies · 371 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 Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago