【发布时间】:2017-11-24 16:31:18
【问题描述】:
我在 Shopify 中创建了一个名为 Slideshow with Button 的新主题部分。我一直在添加允许客户端成功添加自己的按钮文本的功能,但现在在尝试创建自定义按钮背景颜色的功能时卡住了。主要问题是流动代码没有填充 CSS。这是我现在的液体部分文件中的内容:
{% if block.settings.link != blank %}
<a href="{{ block.settings.link }}" class="dynamic_button_link">
{% endif %}
<style>
.dynamic-button {
background-color:{{ section.settings.button_bg_color }}!important;
z-index:999;
}
</style>
{% unless block.settings.button_text == blank %}
<div class='dynamic-button'>{{ block.settings.button_text | escape }}</div>
{% endunless %}
{% if block.settings.link != blank %}
</a>
{% endif %}
{
"type": "color",
"id": "button_bg_color",
"label": "Background color",
"default": "#ffffff"
},
颜色选择器正常显示,但是...
显然动态颜色类型没有按预期填充 CSS...
任何帮助将不胜感激。谢谢。
【问题讨论】:
标签: html css dynamic shopify liquid