statamic / v2-docs

Statamic v2 Documentation
https://v2.statamic.com
54 stars 133 forks source link

Output modifier for inline CSS #385

Closed justingeeslin closed 5 years ago

justingeeslin commented 5 years ago

Inline CSS is used a lot in e-mail templates, and so I tried inlining CSS like so:

{{ theme:css src="style" | output }}

I see now the output modifier is only for asset files. I was hoping from the SVG example this would also work with CSS.

What's the best way to inline CSS in a template? My use case is building e-mail templates in Statamic where remote assets rarely extend beyond images. Any advice or best practices is appreciated.

justingeeslin commented 5 years ago

Found a solution with:

{{ theme:output src="/css/style.css" }}