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

Adding Twig in a css

Started by Muut Archive 10 years ago · 4 replies · 627 views
10 years ago

Hello,

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

10 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 Deleted User, 9 years ago
0 1360 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1122 9 years ago