rebly-sections 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/assets/data/component-library/blog-posts-grid.liquid +174 -34
  2. package/assets/data/component-library/collection-list.liquid +144 -29
  3. package/assets/data/component-library/cta-banner.liquid +92 -27
  4. package/assets/data/component-library/faq-accordion.liquid +82 -27
  5. package/assets/data/component-library/features-grid.liquid +289 -82
  6. package/assets/data/component-library/hero-banner.liquid +139 -112
  7. package/assets/data/component-library/image-gallery.liquid +250 -67
  8. package/assets/data/component-library/image-with-text.liquid +188 -39
  9. package/assets/data/component-library/logo-cloud.liquid +163 -26
  10. package/assets/data/component-library/newsletter-signup.liquid +156 -31
  11. package/assets/data/component-library/pricing-table.liquid +172 -156
  12. package/assets/data/component-library/product-grid.liquid +168 -33
  13. package/assets/data/component-library/rich-text-content.liquid +156 -26
  14. package/assets/data/component-library/stats-counter.liquid +164 -31
  15. package/assets/data/component-library/team-members.liquid +171 -34
  16. package/assets/data/component-library/testimonials-slider.liquid +285 -91
  17. package/assets/data/component-library/video-hero.liquid +179 -32
  18. package/assets/data/design-tokens.csv +6 -0
  19. package/assets/data/schema-library.csv +6 -1
  20. package/assets/data/shopify-best-practices.csv +4 -1
  21. package/assets/scripts/quality-gate-checks.py +109 -22
  22. package/assets/scripts/quality-gate.py +65 -4
  23. package/assets/templates/generation-prompt.md +65 -20
  24. package/assets/templates/section-base.liquid +124 -3
  25. package/package.json +1 -1
@@ -1,35 +1,40 @@
1
1
  {%- comment -%} rebly-sections: Blog Posts Grid | Category: content | OS2.0 {%- endcomment -%}
2
+ {%- liquid
3
+ assign section_id = section.id
4
+ assign color_mode = section.settings.color_mode | default: 'preset'
5
+ assign preset = section.settings.style_preset | default: 'light'
6
+ -%}
2
7
 
3
- <section id="section-{{ section.id }}" class="blog-posts-grid">
4
- <div class="blog-posts-grid__container">
8
+ <section id="section-{{ section_id }}" class="rebly-blog-posts-grid{% if color_mode == 'theme' %} color-{{ section.settings.color_scheme }}{% else %} rebly-section--{{ preset }}{% endif %}">
9
+ <div class="rebly-blog-posts-grid__container">
5
10
 
6
11
  {%- if section.settings.heading != blank -%}
7
- <h2 class="blog-posts-grid__heading">{{ section.settings.heading | escape }}</h2>
12
+ <h2 class="rebly-blog-posts-grid__heading">{{ section.settings.heading | escape }}</h2>
8
13
  {%- endif -%}
9
14
 
10
15
  {%- for block in section.blocks -%}<div {{ block.shopify_attributes }}></div>{%- endfor -%}
11
16
  {%- assign blog = blogs[section.settings.blog] -%}
12
- <div class="blog-posts-grid__items" style="--cols: {{ section.settings.columns }};">
17
+ <div class="rebly-blog-posts-grid__items" style="--cols: {{ section.settings.columns }};">
13
18
  {%- if blog != blank -%}
14
19
  {%- for article in blog.articles limit: section.settings.posts_to_show -%}
15
- <article class="blog-posts-grid__card">
20
+ <article class="rebly-blog-posts-grid__card">
16
21
  {%- if article.image != blank -%}
17
- <a href="{{ article.url }}" class="blog-posts-grid__card-img-link">
22
+ <a href="{{ article.url }}" class="rebly-blog-posts-grid__card-img-link">
18
23
  {{- article.image | image_url: width: 600 | image_tag: loading: 'lazy', alt: article.title -}}
19
24
  </a>
20
25
  {%- endif -%}
21
- <div class="blog-posts-grid__card-body">
26
+ <div class="rebly-blog-posts-grid__card-body">
22
27
  {%- if section.settings.show_date -%}
23
- <time class="blog-posts-grid__date" datetime="{{ article.published_at | date: '%Y-%m-%d' }}">
28
+ <time class="rebly-blog-posts-grid__date" datetime="{{ article.published_at | date: '%Y-%m-%d' }}">
24
29
  {{ article.published_at | date: '%B %d, %Y' }}
25
30
  </time>
26
31
  {%- endif -%}
27
- <h3 class="blog-posts-grid__card-title"><a href="{{ article.url }}">{{ article.title }}</a></h3>
32
+ <h3 class="rebly-blog-posts-grid__card-title"><a href="{{ article.url }}">{{ article.title }}</a></h3>
28
33
  {%- if section.settings.show_author -%}
29
- <p class="blog-posts-grid__author">{{ article.author }}</p>
34
+ <p class="rebly-blog-posts-grid__author">{{ article.author }}</p>
30
35
  {%- endif -%}
31
36
  {%- if section.settings.show_excerpt and article.excerpt != blank -%}
32
- <p class="blog-posts-grid__excerpt">{{ article.excerpt | strip_html | truncate: 120 }}</p>
37
+ <p class="rebly-blog-posts-grid__excerpt">{{ article.excerpt | strip_html | truncate: 120 }}</p>
33
38
  {%- endif -%}
34
39
  </div>
35
40
  </article>
@@ -43,35 +48,170 @@
43
48
  </section>
44
49
 
45
50
  <style>
46
- #section-{{ section.id }} .blog-posts-grid__container { max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; }
47
- #section-{{ section.id }} .blog-posts-grid__heading { font-size: 2rem; text-align: center; margin: 0 0 2rem; color: inherit; }
48
- #section-{{ section.id }} .blog-posts-grid__items { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 2rem; }
49
- #section-{{ section.id }} .blog-posts-grid__card-img-link img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; }
50
- #section-{{ section.id }} .blog-posts-grid__card-body { padding: 1rem 0; }
51
- #section-{{ section.id }} .blog-posts-grid__date { font-size: 0.8rem; opacity: 0.6; display: block; margin-bottom: 0.4rem; color: inherit; }
52
- #section-{{ section.id }} .blog-posts-grid__card-title { font-size: 1.1rem; margin: 0 0 0.4rem; color: inherit; }
53
- #section-{{ section.id }} .blog-posts-grid__card-title a { text-decoration: none; color: inherit; }
54
- #section-{{ section.id }} .blog-posts-grid__author { font-size: 0.85rem; opacity: 0.65; margin: 0 0 0.5rem; color: inherit; }
55
- #section-{{ section.id }} .blog-posts-grid__excerpt { font-size: 0.9rem; line-height: 1.5; opacity: 0.8; margin: 0; color: inherit; }
56
- @media (max-width: 989px) { #section-{{ section.id }} .blog-posts-grid__items { grid-template-columns: repeat(2, 1fr); } }
57
- @media (max-width: 749px) { #section-{{ section.id }} .blog-posts-grid__items { grid-template-columns: 1fr; } }
51
+ /* Style preset: scoped CSS vars */
52
+ {%- if color_mode == 'preset' -%}
53
+ {%- case preset -%}
54
+ {%- when 'dark' -%}
55
+ #section-{{ section_id }} { --section-bg: #111827; --section-fg: #f9fafb; --section-accent: #60a5fa; }
56
+ {%- when 'accent' -%}
57
+ #section-{{ section_id }} { --section-bg: #2563eb; --section-fg: #ffffff; --section-accent: #93c5fd; }
58
+ {%- when 'custom' -%}
59
+ #section-{{ section_id }} { --section-bg: {{ section.settings.bg_color }}; --section-fg: {{ section.settings.text_color }}; --section-accent: {{ section.settings.accent_color }}; }
60
+ {%- else -%}
61
+ #section-{{ section_id }} { --section-bg: #ffffff; --section-fg: #111827; --section-accent: #2563eb; }
62
+ {%- endcase -%}
63
+ #section-{{ section_id }} { background-color: var(--section-bg); color: var(--section-fg); }
64
+ {%- endif -%}
65
+
66
+ #section-{{ section_id }} .rebly-blog-posts-grid__container { max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; }
67
+ #section-{{ section_id }} .rebly-blog-posts-grid__heading { font-size: 2rem; text-align: center; margin: 0 0 2rem; color: var(--section-fg, inherit); }
68
+ #section-{{ section_id }} .rebly-blog-posts-grid__items { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 2rem; }
69
+ #section-{{ section_id }} .rebly-blog-posts-grid__card-img-link img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; }
70
+ #section-{{ section_id }} .rebly-blog-posts-grid__card-body { padding: 1rem 0; }
71
+ #section-{{ section_id }} .rebly-blog-posts-grid__date { font-size: 0.8rem; opacity: 0.6; display: block; margin-bottom: 0.4rem; color: var(--section-fg, inherit); }
72
+ #section-{{ section_id }} .rebly-blog-posts-grid__card-title { font-size: 1.1rem; margin: 0 0 0.4rem; color: var(--section-fg, inherit); }
73
+ #section-{{ section_id }} .rebly-blog-posts-grid__card-title a { text-decoration: none; color: var(--section-fg, inherit); }
74
+ #section-{{ section_id }} .rebly-blog-posts-grid__author { font-size: 0.85rem; opacity: 0.65; margin: 0 0 0.5rem; color: var(--section-fg, inherit); }
75
+ #section-{{ section_id }} .rebly-blog-posts-grid__excerpt { font-size: 0.9rem; line-height: 1.5; opacity: 0.8; margin: 0; color: var(--section-fg, inherit); }
76
+ @media (max-width: 989px) { #section-{{ section_id }} .rebly-blog-posts-grid__items { grid-template-columns: repeat(2, 1fr); } }
77
+ @media (max-width: 749px) { #section-{{ section_id }} .rebly-blog-posts-grid__items { grid-template-columns: 1fr; } }
58
78
  </style>
59
79
 
60
80
  {% schema %}
61
81
  {
62
- "name": "Blog Posts Grid",
82
+ "name": "Rebly: Blog Posts Grid",
63
83
  "tag": "section",
64
- "class": "section-blog-posts-grid",
84
+ "class": "rebly-section",
65
85
  "settings": [
66
- { "type": "text", "id": "heading", "label": "Heading", "default": "Latest Articles" },
67
- { "type": "blog", "id": "blog", "label": "Blog" },
68
- { "type": "range", "id": "posts_to_show", "label": "Posts to Show", "min": 2, "max": 9, "step": 1, "default": 3 },
69
- { "type": "range", "id": "columns", "label": "Columns", "min": 2, "max": 4, "step": 1, "default": 3 },
70
- { "type": "checkbox", "id": "show_date", "label": "Show Date", "default": true },
71
- { "type": "checkbox", "id": "show_author", "label": "Show Author", "default": false },
72
- { "type": "checkbox", "id": "show_excerpt", "label": "Show Excerpt", "default": true }
86
+ {
87
+ "type": "header",
88
+ "content": "Color Mode"
89
+ },
90
+ {
91
+ "type": "select",
92
+ "id": "color_mode",
93
+ "label": "Color mode",
94
+ "default": "preset",
95
+ "options": [
96
+ {
97
+ "value": "theme",
98
+ "label": "Theme colors"
99
+ },
100
+ {
101
+ "value": "preset",
102
+ "label": "Custom preset"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "type": "color_scheme",
108
+ "id": "color_scheme",
109
+ "label": "Color scheme",
110
+ "default": "scheme-1"
111
+ },
112
+ {
113
+ "type": "select",
114
+ "id": "style_preset",
115
+ "label": "Style preset",
116
+ "default": "light",
117
+ "options": [
118
+ {
119
+ "value": "light",
120
+ "label": "Light"
121
+ },
122
+ {
123
+ "value": "dark",
124
+ "label": "Dark"
125
+ },
126
+ {
127
+ "value": "accent",
128
+ "label": "Accent"
129
+ },
130
+ {
131
+ "value": "custom",
132
+ "label": "Custom"
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "type": "color",
138
+ "id": "bg_color",
139
+ "label": "Background color",
140
+ "default": "#ffffff"
141
+ },
142
+ {
143
+ "type": "color",
144
+ "id": "text_color",
145
+ "label": "Text color",
146
+ "default": "#111827"
147
+ },
148
+ {
149
+ "type": "color",
150
+ "id": "accent_color",
151
+ "label": "Accent color",
152
+ "default": "#2563eb"
153
+ },
154
+ {
155
+ "type": "text",
156
+ "id": "heading",
157
+ "label": "Heading",
158
+ "default": "Latest Articles"
159
+ },
160
+ {
161
+ "type": "blog",
162
+ "id": "blog",
163
+ "label": "Blog"
164
+ },
165
+ {
166
+ "type": "range",
167
+ "id": "posts_to_show",
168
+ "label": "Posts to Show",
169
+ "min": 2,
170
+ "max": 9,
171
+ "step": 1,
172
+ "default": 3
173
+ },
174
+ {
175
+ "type": "range",
176
+ "id": "columns",
177
+ "label": "Columns",
178
+ "min": 2,
179
+ "max": 4,
180
+ "step": 1,
181
+ "default": 3
182
+ },
183
+ {
184
+ "type": "checkbox",
185
+ "id": "show_date",
186
+ "label": "Show Date",
187
+ "default": true
188
+ },
189
+ {
190
+ "type": "checkbox",
191
+ "id": "show_author",
192
+ "label": "Show Author",
193
+ "default": false
194
+ },
195
+ {
196
+ "type": "checkbox",
197
+ "id": "show_excerpt",
198
+ "label": "Show Excerpt",
199
+ "default": true
200
+ }
201
+ ],
202
+ "blocks": [
203
+ {
204
+ "type": "@app"
205
+ }
73
206
  ],
74
- "blocks": [{ "type": "@app" }],
75
- "presets": [{ "name": "Blog Posts Grid" }]
207
+ "presets": [
208
+ {
209
+ "name": "Rebly: Blog Posts Grid — Light",
210
+ "settings": {
211
+ "color_mode": "preset",
212
+ "style_preset": "light"
213
+ }
214
+ }
215
+ ]
76
216
  }
77
217
  {% endschema %}
@@ -1,27 +1,32 @@
1
1
  {%- comment -%} rebly-sections: Collection List | Category: product | OS2.0 {%- endcomment -%}
2
+ {%- liquid
3
+ assign section_id = section.id
4
+ assign color_mode = section.settings.color_mode | default: 'preset'
5
+ assign preset = section.settings.style_preset | default: 'light'
6
+ -%}
2
7
 
3
- <section id="section-{{ section.id }}" class="collection-list">
4
- <div class="collection-list__container">
8
+ <section id="section-{{ section_id }}" class="rebly-collection-list{% if color_mode == 'theme' %} color-{{ section.settings.color_scheme }}{% else %} rebly-section--{{ preset }}{% endif %}">
9
+ <div class="rebly-collection-list__container">
5
10
 
6
11
  {%- if section.settings.heading != blank -%}
7
- <h2 class="collection-list__heading">{{ section.settings.heading | escape }}</h2>
12
+ <h2 class="rebly-collection-list__heading">{{ section.settings.heading | escape }}</h2>
8
13
  {%- endif -%}
9
14
 
10
- <div class="collection-list__grid">
15
+ <div class="rebly-collection-list__grid">
11
16
  {%- for block in section.blocks -%}
12
17
  {%- if block.type == 'collection' -%}
13
18
  {%- assign col = collections[block.settings.collection] -%}
14
- <a href="{{ col.url }}" class="collection-list__card" {{ block.shopify_attributes }}>
15
- <div class="collection-list__card-image">
19
+ <a href="{{ col.url }}" class="rebly-collection-list__card" {{ block.shopify_attributes }}>
20
+ <div class="rebly-collection-list__card-image">
16
21
  {%- if col.image != blank -%}
17
22
  {{- col.image | image_url: width: 600 | image_tag: loading: 'lazy', alt: col.title -}}
18
23
  {%- else -%}
19
24
  {{ 'collection-1' | placeholder_svg_tag }}
20
25
  {%- endif -%}
21
26
  </div>
22
- <div class="collection-list__card-info">
23
- <h3 class="collection-list__card-title">{{ col.title }}</h3>
24
- <span class="collection-list__card-count">{{ col.products_count }} products</span>
27
+ <div class="rebly-collection-list__card-info">
28
+ <h3 class="rebly-collection-list__card-title">{{ col.title }}</h3>
29
+ <span class="rebly-collection-list__card-count">{{ col.products_count }} products</span>
25
30
  </div>
26
31
  </a>
27
32
  {%- endif -%}
@@ -32,40 +37,150 @@
32
37
  </section>
33
38
 
34
39
  <style>
35
- #section-{{ section.id }} .collection-list__container { max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; }
36
- #section-{{ section.id }} .collection-list__heading { font-size: 2rem; text-align: center; margin: 0 0 2rem; color: inherit; }
37
- #section-{{ section.id }} .collection-list__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
38
- #section-{{ section.id }} .collection-list__card { text-decoration: none; color: inherit; display: block; border-radius: 6px; overflow: hidden; }
39
- #section-{{ section.id }} .collection-list__card-image img,
40
- #section-{{ section.id }} .collection-list__card-image svg { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
41
- #section-{{ section.id }} .collection-list__card-info { padding: 0.75rem; }
42
- #section-{{ section.id }} .collection-list__card-title { font-size: 1.1rem; margin: 0 0 0.25rem; color: inherit; }
43
- #section-{{ section.id }} .collection-list__card-count { font-size: 0.85rem; opacity: 0.6; color: inherit; }
44
- @media (max-width: 989px) { #section-{{ section.id }} .collection-list__grid { grid-template-columns: repeat(2, 1fr); } }
45
- @media (max-width: 749px) { #section-{{ section.id }} .collection-list__grid { grid-template-columns: repeat(2, 1fr); } }
40
+ /* Style preset: scoped CSS vars */
41
+ {%- if color_mode == 'preset' -%}
42
+ {%- case preset -%}
43
+ {%- when 'dark' -%}
44
+ #section-{{ section_id }} { --section-bg: #111827; --section-fg: #f9fafb; --section-accent: #60a5fa; }
45
+ {%- when 'accent' -%}
46
+ #section-{{ section_id }} { --section-bg: #2563eb; --section-fg: #ffffff; --section-accent: #93c5fd; }
47
+ {%- when 'custom' -%}
48
+ #section-{{ section_id }} { --section-bg: {{ section.settings.bg_color }}; --section-fg: {{ section.settings.text_color }}; --section-accent: {{ section.settings.accent_color }}; }
49
+ {%- else -%}
50
+ #section-{{ section_id }} { --section-bg: #ffffff; --section-fg: #111827; --section-accent: #2563eb; }
51
+ {%- endcase -%}
52
+ #section-{{ section_id }} { background-color: var(--section-bg); color: var(--section-fg); }
53
+ {%- endif -%}
54
+
55
+ #section-{{ section_id }} .rebly-collection-list__container { max-width: 1200px; margin: 0 auto; padding: 4rem 2rem; }
56
+ #section-{{ section_id }} .rebly-collection-list__heading { font-size: 2rem; text-align: center; margin: 0 0 2rem; color: var(--section-fg, inherit); }
57
+ #section-{{ section_id }} .rebly-collection-list__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
58
+ #section-{{ section_id }} .rebly-collection-list__card { text-decoration: none; color: var(--section-fg, inherit); display: block; border-radius: 6px; overflow: hidden; }
59
+ #section-{{ section_id }} .rebly-collection-list__card-image img,
60
+ #section-{{ section_id }} .rebly-collection-list__card-image svg { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
61
+ #section-{{ section_id }} .rebly-collection-list__card-info { padding: 0.75rem; }
62
+ #section-{{ section_id }} .rebly-collection-list__card-title { font-size: 1.1rem; margin: 0 0 0.25rem; color: var(--section-fg, inherit); }
63
+ #section-{{ section_id }} .rebly-collection-list__card-count { font-size: 0.85rem; opacity: 0.6; color: var(--section-fg, inherit); }
64
+ @media (max-width: 989px) { #section-{{ section_id }} .rebly-collection-list__grid { grid-template-columns: repeat(2, 1fr); } }
65
+ @media (max-width: 749px) { #section-{{ section_id }} .rebly-collection-list__grid { grid-template-columns: repeat(2, 1fr); } }
46
66
  </style>
47
67
 
48
68
  {% schema %}
49
69
  {
50
- "name": "Collection List",
70
+ "name": "Rebly: Collection List",
51
71
  "tag": "section",
52
- "class": "section-collection-list",
72
+ "class": "rebly-section",
53
73
  "settings": [
54
- { "type": "text", "id": "heading", "label": "Heading", "default": "Shop by Collection" }
74
+ {
75
+ "type": "header",
76
+ "content": "Color Mode"
77
+ },
78
+ {
79
+ "type": "select",
80
+ "id": "color_mode",
81
+ "label": "Color mode",
82
+ "default": "preset",
83
+ "options": [
84
+ {
85
+ "value": "theme",
86
+ "label": "Theme colors"
87
+ },
88
+ {
89
+ "value": "preset",
90
+ "label": "Custom preset"
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "type": "color_scheme",
96
+ "id": "color_scheme",
97
+ "label": "Color scheme",
98
+ "default": "scheme-1"
99
+ },
100
+ {
101
+ "type": "select",
102
+ "id": "style_preset",
103
+ "label": "Style preset",
104
+ "default": "light",
105
+ "options": [
106
+ {
107
+ "value": "light",
108
+ "label": "Light"
109
+ },
110
+ {
111
+ "value": "dark",
112
+ "label": "Dark"
113
+ },
114
+ {
115
+ "value": "accent",
116
+ "label": "Accent"
117
+ },
118
+ {
119
+ "value": "custom",
120
+ "label": "Custom"
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "type": "color",
126
+ "id": "bg_color",
127
+ "label": "Background color",
128
+ "default": "#ffffff"
129
+ },
130
+ {
131
+ "type": "color",
132
+ "id": "text_color",
133
+ "label": "Text color",
134
+ "default": "#111827"
135
+ },
136
+ {
137
+ "type": "color",
138
+ "id": "accent_color",
139
+ "label": "Accent color",
140
+ "default": "#2563eb"
141
+ },
142
+ {
143
+ "type": "text",
144
+ "id": "heading",
145
+ "label": "Heading",
146
+ "default": "Shop by Collection"
147
+ }
55
148
  ],
56
149
  "blocks": [
57
150
  {
58
151
  "type": "collection",
59
152
  "name": "Collection",
60
153
  "settings": [
61
- { "type": "collection", "id": "collection", "label": "Collection" }
154
+ {
155
+ "type": "collection",
156
+ "id": "collection",
157
+ "label": "Collection"
158
+ }
62
159
  ]
63
160
  },
64
- { "type": "@app" }
161
+ {
162
+ "type": "@app"
163
+ }
65
164
  ],
66
- "presets": [{
67
- "name": "Collection List",
68
- "blocks": [{ "type": "collection" }, { "type": "collection" }, { "type": "collection" }]
69
- }]
165
+ "presets": [
166
+ {
167
+ "name": "Rebly: Collection List Light",
168
+ "settings": {
169
+ "color_mode": "preset",
170
+ "style_preset": "light"
171
+ },
172
+ "blocks": [
173
+ {
174
+ "type": "collection"
175
+ },
176
+ {
177
+ "type": "collection"
178
+ },
179
+ {
180
+ "type": "collection"
181
+ }
182
+ ]
183
+ }
184
+ ]
70
185
  }
71
186
  {% endschema %}
@@ -1,17 +1,27 @@
1
1
  {%- comment -%} rebly-sections: CTA Banner | Category: conversion | OS2.0 {%- endcomment -%}
2
+ {%- liquid
3
+ assign section_id = section.id
4
+ assign color_mode = section.settings.color_mode | default: 'preset'
5
+ assign preset = section.settings.style_preset | default: 'light'
6
+ assign heading_font = section.settings.heading_font
7
+ assign btn_style = section.settings.button_style | default: 'filled'
8
+ -%}
2
9
 
3
- <section id="section-{{ section.id }}" class="cta-banner">
10
+ <section
11
+ id="section-{{ section_id }}"
12
+ class="rebly-cta-banner{% if color_mode == 'theme' %} color-{{ section.settings.color_scheme }}{% else %} rebly-section--{{ preset }}{% endif %}"
13
+ >
4
14
  {%- for block in section.blocks -%}<div {{ block.shopify_attributes }}></div>{%- endfor -%}
5
- <div class="cta-banner__inner" style="--bg: {{ section.settings.background_color }}; --color: {{ section.settings.text_color }};">
6
- <div class="cta-banner__content">
15
+ <div class="rebly-cta-banner__inner">
16
+ <div class="rebly-cta-banner__content">
7
17
  {%- if section.settings.heading != blank -%}
8
- <h2 class="cta-banner__heading">{{ section.settings.heading | escape }}</h2>
18
+ <h2 class="rebly-cta-banner__heading">{{ section.settings.heading | escape }}</h2>
9
19
  {%- endif -%}
10
20
  {%- if section.settings.text != blank -%}
11
- <p class="cta-banner__text">{{ section.settings.text | escape }}</p>
21
+ <p class="rebly-cta-banner__text">{{ section.settings.text | escape }}</p>
12
22
  {%- endif -%}
13
23
  {%- if section.settings.button_label != blank -%}
14
- <a href="{{ section.settings.button_link }}" class="cta-banner__btn">
24
+ <a href="{{ section.settings.button_link }}" class="rebly-cta-banner__btn rebly-cta-banner__btn--{{ btn_style }}">
15
25
  {{ section.settings.button_label | escape }}
16
26
  </a>
17
27
  {%- endif -%}
@@ -20,39 +30,94 @@
20
30
  </section>
21
31
 
22
32
  <style>
23
- #section-{{ section.id }} .cta-banner__inner {
24
- background: var(--bg, #000);
25
- color: var(--color, #fff);
26
- padding: 4rem 2rem;
27
- text-align: center;
33
+ /*/* Font: system font guard — must be inside style tag */
34
+ {%- if heading_font -%}
35
+ {%- unless heading_font.system? -%}
36
+ {{ heading_font | font_face: font_display: 'swap' }}
37
+ {%- endunless -%}
38
+ #section-{{ section_id }} {
39
+ --heading-font: {{ heading_font.family }}, {{ heading_font.fallback_families }};
40
+ --heading-weight: {{ heading_font.weight }};
41
+ }
42
+ {%- endif -%}
43
+
44
+ /* Style preset: scoped CSS vars */
45
+ {%- if color_mode == 'preset' -%}
46
+ {%- case preset -%}
47
+ {%- when 'dark' -%}
48
+ #section-{{ section_id }} { --section-bg: #111827; --section-fg: #f9fafb; --section-accent: #60a5fa; }
49
+ {%- when 'accent' -%}
50
+ #section-{{ section_id }} { --section-bg: #2563eb; --section-fg: #ffffff; --section-accent: #93c5fd; }
51
+ {%- when 'custom' -%}
52
+ #section-{{ section_id }} { --section-bg: {{ section.settings.bg_color }}; --section-fg: {{ section.settings.text_color }}; --section-accent: {{ section.settings.accent_color }}; }
53
+ {%- else -%}
54
+ #section-{{ section_id }} { --section-bg: #ffffff; --section-fg: #111827; --section-accent: #2563eb; }
55
+ {%- endcase -%}
56
+ #section-{{ section_id }} { background-color: var(--section-bg); color: var(--section-fg); }
57
+ {%- endif -%}
58
+
59
+ #section-{{ section_id }} .rebly-cta-banner__inner { padding: 4rem 2rem; text-align: center; }
60
+ #section-{{ section_id }} .rebly-cta-banner__content { max-width: 700px; margin: 0 auto; }
61
+ #section-{{ section_id }} .rebly-cta-banner__heading {
62
+ font-family: var(--heading-font); font-weight: var(--heading-weight);
63
+ font-size: 2.25rem; margin: 0 0 1rem; color: var(--section-fg, inherit);
28
64
  }
29
- #section-{{ section.id }} .cta-banner__content { max-width: 700px; margin: 0 auto; }
30
- #section-{{ section.id }} .cta-banner__heading { font-size: 2.25rem; margin: 0 0 1rem; color: var(--color, #ffffff); }
31
- #section-{{ section.id }} .cta-banner__text { font-size: 1.125rem; margin: 0 0 1.5rem; opacity: 0.85; color: var(--color, #ffffff); }
32
- #section-{{ section.id }} .cta-banner__btn {
65
+ #section-{{ section_id }} .rebly-cta-banner__text { font-size: 1.125rem; margin: 0 0 1.5rem; opacity: 0.85; color: var(--section-fg, inherit); }
66
+ /* Button variants */
67
+ #section-{{ section_id }} .rebly-cta-banner__btn {
33
68
  display: inline-block; padding: 0.85rem 2rem;
34
- border: 2px solid currentColor; border-radius: 4px;
35
- text-decoration: none; color: inherit; font-weight: 600;
36
- transition: background 0.2s, color 0.2s;
69
+ border-radius: {{ section.settings.button_border_radius }}px;
70
+ text-decoration: none; font-weight: 600; cursor: pointer;
71
+ transition: filter 0.2s ease;
72
+ }
73
+ #section-{{ section_id }} .rebly-cta-banner__btn:hover { filter: brightness(0.9); }
74
+ #section-{{ section_id }} .rebly-cta-banner__btn--filled { background: var(--section-accent); color: var(--section-bg); border: none; }
75
+ #section-{{ section_id }} .rebly-cta-banner__btn--outline { background: transparent; color: var(--section-accent); border: 2px solid var(--section-accent); }
76
+ #section-{{ section_id }} .rebly-cta-banner__btn--ghost { background: transparent; color: var(--section-fg); border: none; }
77
+ #section-{{ section_id }} .rebly-cta-banner__btn--link { background: none; border: none; color: var(--section-accent); text-decoration: underline; padding: 0; }
78
+ @media (prefers-reduced-motion: reduce) {
79
+ #section-{{ section_id }} .rebly-cta-banner__btn { transition: none; }
80
+ }
81
+ @media (max-width: 749px) {
82
+ #section-{{ section_id }} .rebly-cta-banner__heading { font-size: 1.75rem; }
37
83
  }
38
- #section-{{ section.id }} .cta-banner__btn:hover { background: var(--color, #fff); color: var(--bg, #000); }
39
- @media (max-width: 749px) { #section-{{ section.id }} .cta-banner__heading { font-size: 1.75rem; } }
40
84
  </style>
41
85
 
42
86
  {% schema %}
43
87
  {
44
- "name": "CTA Banner",
88
+ "name": "Rebly: CTA Banner",
45
89
  "tag": "section",
46
- "class": "section-cta-banner",
90
+ "class": "rebly-section",
47
91
  "settings": [
92
+ { "type": "header", "content": "Color Mode" },
93
+ { "type": "select", "id": "color_mode", "label": "Color mode", "default": "preset", "options": [
94
+ { "value": "theme", "label": "Theme colors" }, { "value": "preset", "label": "Custom preset" }
95
+ ] },
96
+ { "type": "color_scheme", "id": "color_scheme", "label": "Color scheme", "default": "scheme-1" },
97
+ { "type": "select", "id": "style_preset", "label": "Style preset", "default": "dark", "options": [
98
+ { "value": "light", "label": "Light" }, { "value": "dark", "label": "Dark" },
99
+ { "value": "accent", "label": "Accent" }, { "value": "custom", "label": "Custom" }
100
+ ] },
101
+ { "type": "color", "id": "bg_color", "label": "Background color", "default": "#000000" },
102
+ { "type": "color", "id": "text_color", "label": "Text color", "default": "#ffffff" },
103
+ { "type": "color", "id": "accent_color", "label": "Accent color", "default": "#60a5fa" },
104
+ { "type": "header", "content": "Content" },
105
+ { "type": "font_picker", "id": "heading_font", "label": "Heading font", "default": "assistant_n4" },
48
106
  { "type": "text", "id": "heading", "label": "Heading", "default": "Ready to get started?" },
49
107
  { "type": "text", "id": "text", "label": "Text", "default": "Join thousands of happy customers." },
50
- { "type": "text", "id": "button_label", "label": "Button Label", "default": "Shop Now" },
51
- { "type": "url", "id": "button_link", "label": "Button Link" },
52
- { "type": "color_background", "id": "background_color", "label": "Background", "default": "#000000" },
53
- { "type": "color", "id": "text_color", "label": "Text Color", "default": "#ffffff" }
108
+ { "type": "header", "content": "Button" },
109
+ { "type": "text", "id": "button_label", "label": "Button label", "default": "Shop Now" },
110
+ { "type": "url", "id": "button_link", "label": "Button link" },
111
+ { "type": "select", "id": "button_style", "label": "Button style", "default": "filled", "options": [
112
+ { "value": "filled", "label": "Filled" }, { "value": "outline", "label": "Outline" },
113
+ { "value": "ghost", "label": "Ghost" }, { "value": "link", "label": "Link" }
114
+ ] },
115
+ { "type": "range", "id": "button_border_radius", "label": "Button radius (px)", "min": 0, "max": 50, "step": 2, "default": 4, "unit": "px" }
54
116
  ],
55
117
  "blocks": [{ "type": "@app" }],
56
- "presets": [{ "name": "CTA Banner" }]
118
+ "presets": [
119
+ { "name": "Rebly: CTA Banner — Dark", "settings": { "color_mode": "preset", "style_preset": "dark" } },
120
+ { "name": "Rebly: CTA Banner — Accent", "settings": { "color_mode": "preset", "style_preset": "accent" } }
121
+ ]
57
122
  }
58
123
  {% endschema %}