【发布时间】:2018-04-06 16:28:20
【问题描述】:
我想在文件 html.html.twig 中插入一个带有内联 CSS 的样式标签 我正在运行带有 Bartik 主题的 Drupal 8。 我希望它在前端看起来像这样。
<style media="all">
html{background:#fff;color:#000;}body{margin:0;}...
</style>
我已经尝试过这个解决方案。
<style media="all">
{% include directory ~ '/sites/default/files/css/inline.css' ignore missing %}
</style>
但后来我只收到回复<style media="all"></style>
我尝试将自定义 CSS 添加为库,它工作正常,但我想要 <css-placeholder token="{{ placeholder_token }}"> 之外的 CSS(如果我想移动它)。
【问题讨论】: