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 →

Adding Twig in a css

Started by Muut Archive 11 years ago · 4 replies · 868 views
11 years ago

Hello,

I wanted to know if i could use twig in a .css file?

11 years ago

No that's not possible. CSS files are loaded directly by the browser and must be valid CSS only. You can however use a CSS pre processor like SASS/LESS etc. This way you can create CSS with variables.

10 years ago

Is there no way to configure twig to compile custom.css.twig? I'm trying to build a customizable theme that allows you to set theme colors in the configuration, and the best way would be to spit out the color vars into a custom css file — otherwise I'll have to inline style the whole thing.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Muut Archive, 10 years ago
1 674 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5337 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago