Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-beeclever committed Sep 16, 2024
1 parent e1ab4f7 commit c72de97
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .shopifyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package.json
package-lock.json
.gitignore
.DS_Store
.prettierignore
.prettierrc
9 changes: 0 additions & 9 deletions LICENSE.md

This file was deleted.

26 changes: 26 additions & 0 deletions assets/critical.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,29 @@ a {
background: var(--background-color);
color: var(--color);
}

/* Spacing System */
.spacing-bottom-2xs{
padding-bottom: 4px;
}
.spacing-bottom-xs{
padding-bottom: 8px;
}
.spacing-bottom-s{
padding-bottom: 12px;
}
.spacing-bottom-m{
padding-bottom: 16px;
}
.spacing-bottom-l{
padding-bottom: 20px;
}
.spacing-bottom-xl{
padding-bottom: 28px;
}
.spacing-bottom-2xl{
padding-bottom: 40px;
}
.spacing-bottom-3xl{
padding-bottom: 60px;
}
43 changes: 31 additions & 12 deletions blocks/button.liquid
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<button type="{{ block.settings.type }}">
<span class="button-label">
{{ block.settings.label }}
</span>
<svg
focusable="false"
class="button-spinner"
viewBox="0 0 66 66"
xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
</svg>
</button>
<div class="spacing-bottom-{{ block.settings.spacing_bottom }}">
<button type="{{ block.settings.type }}">
<span class="button-label">
{{ block.settings.label }}
</span>
<svg
focusable="false"
class="button-spinner"
viewBox="0 0 66 66"
xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
</svg>
</button>
</div>

{% comment %} Todo: loading & disabled state {% endcomment %}
{% comment %} Todo: Only inside forms {% endcomment %}
Expand Down Expand Up @@ -64,6 +66,23 @@
}
],
"default": "btn btn--primary"
},
{
"type": "select",
"id": "spacing_bottom",
"label": "Spacing bottom",
"options": [
{ "value": "none", "label": "none" },
{ "value": "2xs", "label": "2xs" },
{ "value": "xs", "label": "xs" },
{ "value": "s", "label": "s" },
{ "value": "m", "label": "m" },
{ "value": "l", "label": "l" },
{ "value": "xl", "label": "xl" },
{ "value": "2xl", "label": "2xl" },
{ "value": "3xl", "label": "3xl" }
],
"default": "none"
}
],
"presets": [
Expand Down
19 changes: 18 additions & 1 deletion blocks/heading.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% comment %} Should make a setting to decide which type of heading we're outputting instead of a heading size one. {% endcomment %}
<{{ block.settings.html_tag }}
class="shopify-block-heading {{ block.settings | class_list }} {{ block.settings.heading_style }} text-{{ block.settings.alignment }}"
class="shopify-block-heading {{ block.settings | class_list }} {{ block.settings.heading_style }} text-{{ block.settings.alignment }} spacing-bottom-{{ block.settings.spacing_bottom }}"
{{ block.shopify_attributes }}>
{{ block.settings.heading }}
</{{ block.settings.html_tag }}>
Expand Down Expand Up @@ -89,6 +89,23 @@
"id": "alignment",
"label": "Text alignment",
"default": "center"
},
{
"type": "select",
"id": "spacing_bottom",
"label": "Spacing bottom",
"options": [
{ "value": "none", "label": "none" },
{ "value": "2xs", "label": "2xs" },
{ "value": "xs", "label": "xs" },
{ "value": "s", "label": "s" },
{ "value": "m", "label": "m" },
{ "value": "l", "label": "l" },
{ "value": "xl", "label": "xl" },
{ "value": "2xl", "label": "2xl" },
{ "value": "3xl", "label": "3xl" }
],
"default": "none"
}
],
"presets": [{ "name": "Heading" }]
Expand Down
19 changes: 18 additions & 1 deletion blocks/link.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a
href="{{ block.settings.link }}"
class="shopify-block-link {{ block.settings.button_style }}"
class="shopify-block-link {{ block.settings.button_style }} spacing-bottom-{{ block.settings.spacing_bottom }}"
{%- if block.settings.open_in_new_tab -%}
target="_blank" rel="noopener noreferrer"
{%- endif -%}
Expand Down Expand Up @@ -55,6 +55,23 @@
"id": "open_in_new_tab",
"label": "Open this link in a new window",
"default": false
},
{
"type": "select",
"id": "spacing_bottom",
"label": "Spacing bottom",
"options": [
{ "value": "none", "label": "none" },
{ "value": "2xs", "label": "2xs" },
{ "value": "xs", "label": "xs" },
{ "value": "s", "label": "s" },
{ "value": "m", "label": "m" },
{ "value": "l", "label": "l" },
{ "value": "xl", "label": "xl" },
{ "value": "2xl", "label": "2xl" },
{ "value": "3xl", "label": "3xl" }
],
"default": "none"
}
],
"presets": [
Expand Down
19 changes: 18 additions & 1 deletion blocks/text.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div
class="shopify-block-text {{ block.settings | class_list }} {{ block.settings.text_style }} text-{{ block.settings.alignment }}"
class="shopify-block-text {{ block.settings | class_list }} {{ block.settings.text_style }} text-{{ block.settings.alignment }} spacing-bottom-{{ block.settings.spacing_bottom }}"
{{ block.shopify_attributes }}>
{{ block.settings.text }}
</div>
Expand Down Expand Up @@ -40,6 +40,23 @@
"id": "alignment",
"label": "Text alignment",
"default": "center"
},
{
"type": "select",
"id": "spacing_bottom",
"label": "Spacing bottom",
"options": [
{ "value": "none", "label": "none" },
{ "value": "2xs", "label": "2xs" },
{ "value": "xs", "label": "xs" },
{ "value": "s", "label": "s" },
{ "value": "m", "label": "m" },
{ "value": "l", "label": "l" },
{ "value": "xl", "label": "xl" },
{ "value": "2xl", "label": "2xl" },
{ "value": "3xl", "label": "3xl" }
],
"default": "none"
}
],
"presets": [{ "name": "Text" }]
Expand Down

0 comments on commit c72de97

Please sign in to comment.