diff --git a/FAQ/sections/faq.liquid b/FAQ/sections/faq.liquid index a1527a2..9a685c9 100644 --- a/FAQ/sections/faq.liquid +++ b/FAQ/sections/faq.liquid @@ -1,36 +1,55 @@ {%- comment -%} ---------------- THE CSS ---------------- {%- endcomment -%} +{%- assign id = '#shopify-section-' | append: section.id -%} + +{% style %} + {{ id }} { + background: {{ section.settings.background_color }}; + --panel-bg: {{ section.settings.panel_color }}; + --border-color: {{ section.settings.border_color }}; + --question-color: {{ section.settings.q_color }}; + --answer-color: {{ section.settings.a_color }}; + + {%- assign min = section.settings.q_size_small -%} + {%- assign max = section.settings.q_size_large -%} + {%- assign min_rem = min | append: 'rem' -%} + {%- assign max_rem = max | append: 'rem' -%} + --title-font-size: clamp( + {{ min_rem }}, + calc({{ min_rem }} + ({{ max }} - {{ min }}) * ((100vw - 25rem) / (64 - 25))), + {{ max_rem }}); + } +{% endstyle %} + {%- comment -%} ---------------- THE MARKUP ---------------- {%- endcomment -%} -
- {%- for block in section.blocks -%} + +{%- for block in section.blocks -%} {%- if block.settings.title != blank and block.settings.content != blank -%} {%- if block.settings.checkbox_expanded == true -%} @@ -78,22 +92,22 @@ {%- assign hidden = 'hidden' -%} {%- endif -%} -

-

- +{%- endfor -%} {%- comment -%} -------------- THE RICH SCHEMA ------------- {%- endcomment -%} @@ -136,9 +150,19 @@ { "name": "FAQ", "class": "sd-faq", - "tag": "section", + "tag": "article", "settings": [ + { + "type": "header", + "content": "Colors" + }, + { + "type": "color", + "id": "background_color", + "label": "Background color", + "default": "#ffffff" + }, { "type": "color", "id": "border_color", @@ -148,7 +172,46 @@ { "type": "color", "id": "panel_color", - "label": "Panel color" + "label": "Panel color", + "default": "#fdfdfd" + }, + { + "type": "header", + "content": "Question" + }, + { + "type": "range", + "id": "q_size_small", + "min": 1, + "max": 2, + "step": 0.1, + "unit": "rem", + "label": "Small devices font size", + "default": 1 + }, + { + "type": "range", + "id": "q_size_large", + "min": 1, + "max": 3, + "step": 0.1, + "unit": "rem", + "label": "Large devices font size", + "default": 1.4 + }, + { + "type": "color", + "id": "q_color", + "label": "Question text color" + }, + { + "type": "header", + "content": "Answer" + }, + { + "type": "color", + "id": "a_color", + "label": "Answer text color" } ], @@ -204,7 +267,7 @@ {%- comment -%} ---------------- THE EDITOR ------------------ {%- endcomment -%} -{%- if section.blocks[0].shopify_attributes != blank -%} +{%- if request.design_mode -%}