Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert global section settings #911

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -277,24 +277,6 @@ body,
}
}

.section-wrapper {
border-radius: var(--sections-radius);
border: var(--sections-border-width) solid rgba(var(--color-foreground), var(--sections-border-opacity));
overflow: hidden;
}

.section-wrapper.section-wrapper--fullwidth {
padding-left: 0;
padding-right: 0;
border-radius: 0;
border-left: 0;
border-right: 0;
}

.section-wrapper--padded {
padding: 2rem;
}

.grid-auto-flow {
display: grid;
grid-auto-flow: column;
Expand Down
55 changes: 10 additions & 45 deletions config/settings_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -625,51 +625,6 @@
}
]
},
{
"name": "Sections",
"settings": [
{
"type": "range",
"id": "sections_spacing",
"min": 0,
"max": 80,
"step": 4,
"unit": "px",
"label": "Vertical spacing between sections",
"default": 40
},
{
"type": "range",
"id": "sections_border_opacity",
"min": 0,
"max": 100,
"step": 5,
"unit": "%",
"label": "Border opacity",
"default": 50
},
{
"type": "range",
"id": "sections_border_width",
"min": 0,
"max": 10,
"step": 1,
"unit": "px",
"label": "Border thickness",
"default": 0
},
{
"type": "range",
"id": "sections_radius",
"min": 0,
"max": 30,
"step": 3,
"unit": "px",
"label": "Corner radius",
"default": 0
}
]
},
{
"name": "t:settings_schema.typography.name",
"settings": [
Expand Down Expand Up @@ -845,6 +800,16 @@
"default": "1600",
"label": "t:settings_schema.layout.settings.page_width.label"
},
{
"type": "range",
"id": "sections_spacing",
"min": 0,
"max": 40,
"step": 4,
"unit": "px",
"label": "Vertical spacing between sections",
"default": 20
},
{
"type": "paragraph",
"content": "Affects collection, search and blog pages. Also affects collage, collection, collection list, multicolumn and blog sections."
Expand Down
5 changes: 0 additions & 5 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@

--sections-spacing: {{ settings.sections_spacing }}px;
--sections-safe-spacing: {% if settings.sections_spacing < 15 %}15{% else %}{{settings.sections_spacing}}{% endif %}px;
--sections-padding: 20px;
--sections-radius: {{ settings.sections_radius }}px;
--sections-border-width: {{ settings.sections_border_width }}px;
--sections-border-opacity: {{ settings.sections_border_opacity | divided_by: 100.0 }};
--sections-border-color: {{ settings.sections_border_color.red }}, {{ settings.sections_border_color.green }}, {{ settings.sections_border_color.blue }};

--popup-drawer-border-width: {{ settings.popup_drawer_border_width }}px;
--popup-drawer-border-opacity: {{ settings.popup_drawer_border_opacity | divided_by: 100.0 }};
Expand Down
326 changes: 162 additions & 164 deletions sections/collage.liquid

Large diffs are not rendered by default.

557 changes: 277 additions & 280 deletions sections/featured-product.liquid

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sections/image-banner.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
{%- endstyle -%}

<div id="Banner-{{ section.id }}" class="section-wrapper section-wrapper--fullwidth banner banner--{{ section.settings.image_height }}{% if section.settings.stack_images_on_mobile and section.settings.image != blank and section.settings.image_2 != blank %} banner--stacked{% endif %}{% if section.settings.adapt_height_first_image and section.settings.image != blank %} banner--adapt{% endif %}{% if section.settings.show_text_below %} banner--mobile-bottom{%- endif -%}{% if section.settings.show_text_box == false %} banner--desktop-transparent{% endif %}">
<div id="Banner-{{ section.id }}" class="banner banner--{{ section.settings.image_height }}{% if section.settings.stack_images_on_mobile and section.settings.image != blank and section.settings.image_2 != blank %} banner--stacked{% endif %}{% if section.settings.adapt_height_first_image and section.settings.image != blank %} banner--adapt{% endif %}{% if section.settings.show_text_below %} banner--mobile-bottom{%- endif -%}{% if section.settings.show_text_box == false %} banner--desktop-transparent{% endif %}">
{%- if section.settings.image != blank -%}
<div class="banner__media media{% if section.settings.image == blank and section.settings.image_2 == blank %} placeholder{% endif %}{% if section.settings.image_2 != blank %} banner__media-half{% endif %}">
<img
Expand Down
88 changes: 43 additions & 45 deletions sections/image-with-text.liquid
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
{{ 'component-image-with-text.css' | asset_url | stylesheet_tag }}

<div class="image-with-text {% if section.settings.full_width %}image-with-text--full-width{% else %}page-width{% endif %} color-scheme-{{ section.settings.color_scheme }}">
<div class="section-wrapper">
<div class="image-with-text__grid color-{{ section.settings.color_scheme }} grid grid--gapless grid--1-col grid--2-col-tablet gradient{% if section.settings.layout == 'text_first' %} image-with-text__grid--reverse{% endif %}">
<div class="grid__item">
<div class="image-with-text__media image-with-text__media--{{ section.settings.height }} {% if section.settings.image != blank %}media{% else %}image-with-text__media--placeholder placeholder{% endif %}"
{% if section.settings.height == 'adapt' and section.settings.image != blank %} style="padding-bottom: {{ 1 | divided_by: section.settings.image.aspect_ratio | times: 100 }}%;"{% endif %}
>
{%- if section.settings.image != blank -%}
<img
srcset="{%- if section.settings.image.width >= 165 -%}{{ section.settings.image | img_url: '165x' }} 165w,{%- endif -%}
{%- if section.settings.image.width >= 360 -%}{{ section.settings.image | img_url: '360x' }} 360w,{%- endif -%}
{%- if section.settings.image.width >= 535 -%}{{ section.settings.image | img_url: '535x' }} 535w,{%- endif -%}
{%- if section.settings.image.width >= 750 -%}{{ section.settings.image | img_url: '750x' }} 750w,{%- endif -%}
{%- if section.settings.image.width >= 1070 -%}{{ section.settings.image | img_url: '1070x' }} 1070w,{%- endif -%}
{%- if section.settings.image.width >= 1500 -%}{{ section.settings.image | img_url: '1500x' }} 1500w,{%- endif -%}
{{ section.settings.image | img_url: 'master' }} {{ section.settings.image.width }}w"
src="{{ section.settings.image | img_url: '1500x' }}"
sizes="(min-width: {{ settings.page_width }}px) {{ settings.page_width | minus: 100 | divided_by: 2 }}px, (min-width: 750px) calc((100vw - 130px) / 2), calc((100vw - 50px) / 2)"
alt="{{ section.settings.image.alt | escape }}"
loading="lazy"
width="{{ section.settings.image.width }}"
height="{{ section.settings.image.height }}"
>
{%- else -%}
{{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
</div>
<div class="image-with-text__grid color-{{ section.settings.color_scheme }} grid grid--gapless grid--1-col grid--2-col-tablet gradient{% if section.settings.layout == 'text_first' %} image-with-text__grid--reverse{% endif %}">
<div class="grid__item">
<div class="image-with-text__media image-with-text__media--{{ section.settings.height }} {% if section.settings.image != blank %}media{% else %}image-with-text__media--placeholder placeholder{% endif %}"
{% if section.settings.height == 'adapt' and section.settings.image != blank %} style="padding-bottom: {{ 1 | divided_by: section.settings.image.aspect_ratio | times: 100 }}%;"{% endif %}
>
{%- if section.settings.image != blank -%}
<img
srcset="{%- if section.settings.image.width >= 165 -%}{{ section.settings.image | img_url: '165x' }} 165w,{%- endif -%}
{%- if section.settings.image.width >= 360 -%}{{ section.settings.image | img_url: '360x' }} 360w,{%- endif -%}
{%- if section.settings.image.width >= 535 -%}{{ section.settings.image | img_url: '535x' }} 535w,{%- endif -%}
{%- if section.settings.image.width >= 750 -%}{{ section.settings.image | img_url: '750x' }} 750w,{%- endif -%}
{%- if section.settings.image.width >= 1070 -%}{{ section.settings.image | img_url: '1070x' }} 1070w,{%- endif -%}
{%- if section.settings.image.width >= 1500 -%}{{ section.settings.image | img_url: '1500x' }} 1500w,{%- endif -%}
{{ section.settings.image | img_url: 'master' }} {{ section.settings.image.width }}w"
src="{{ section.settings.image | img_url: '1500x' }}"
sizes="(min-width: {{ settings.page_width }}px) {{ settings.page_width | minus: 100 | divided_by: 2 }}px, (min-width: 750px) calc((100vw - 130px) / 2), calc((100vw - 50px) / 2)"
alt="{{ section.settings.image.alt | escape }}"
loading="lazy"
width="{{ section.settings.image.width }}"
height="{{ section.settings.image.height }}"
>
{%- else -%}
{{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
</div>
<div class="grid__item">
<div class="image-with-text__content image-with-text__content--{{ section.settings.height }}">
{%- for block in section.blocks -%}
{% case block.type %}
{%- when 'heading' -%}
<h2 class="image-with-text__heading h1" {{ block.shopify_attributes }}>
{{ block.settings.heading | escape }}
</h2>
{%- when 'text' -%}
<div class="image-with-text__text rte" {{ block.shopify_attributes }}>{{ block.settings.text }}</div>
{%- when 'button' -%}
{%- if block.settings.button_label != blank -%}
<a{% if block.settings.button_link == blank %} role="link" aria-disabled="true"{% else %} href="{{ block.settings.button_link }}"{% endif %} class="button{% if block.settings.button_style_secondary %} button--secondary{% else %} button--primary{% endif %}" {{ block.shopify_attributes }}>
{{ block.settings.button_label | escape }}
</a>
{%- endif -%}
{%- endcase -%}
{%- endfor -%}
</div>
</div>
<div class="grid__item">
<div class="image-with-text__content image-with-text__content--{{ section.settings.height }}">
{%- for block in section.blocks -%}
{% case block.type %}
{%- when 'heading' -%}
<h2 class="image-with-text__heading h1" {{ block.shopify_attributes }}>
{{ block.settings.heading | escape }}
</h2>
{%- when 'text' -%}
<div class="image-with-text__text rte" {{ block.shopify_attributes }}>{{ block.settings.text }}</div>
{%- when 'button' -%}
{%- if block.settings.button_label != blank -%}
<a{% if block.settings.button_link == blank %} role="link" aria-disabled="true"{% else %} href="{{ block.settings.button_link }}"{% endif %} class="button{% if block.settings.button_style_secondary %} button--secondary{% else %} button--primary{% endif %}" {{ block.shopify_attributes }}>
{{ block.settings.button_label | escape }}
</a>
{%- endif -%}
{%- endcase -%}
{%- endfor -%}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sections/newsletter.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{ 'newsletter-section.css' | asset_url | stylesheet_tag }}

<div class="newsletter center{% if section.settings.full_width == false %} newsletter--narrow page-width{% endif%}">
<div class="section-wrapper{% if section.settings.full_width %} section-wrapper--fullwidth{% endif %} newsletter__wrapper color-{{ section.settings.color_scheme }} gradient">
<div class="newsletter__wrapper color-{{ section.settings.color_scheme }} gradient">
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when '@app' -%}
Expand Down
32 changes: 15 additions & 17 deletions sections/page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@
<noscript>{{ 'section-main-page.css' | asset_url | stylesheet_tag }}</noscript>

<div class="page-width page-width--narrow">
<div class="section-wrapper section-wrapper--padded">
<h2 class="page-title">
{%- if section.settings.page.title != blank -%}
{{ section.settings.page.title | escape }}
{%- else -%}
Page title
{%- endif -%}
</h2>
<div class="rte">
{%- if section.settings.page.content != blank -%}
{{ section.settings.page.content }}
{%- else -%}
<div class='page-placeholder-wrapper placeholder'>
{{ 'page' | placeholder_svg_tag: 'page-placeholder' }}
</div>
{%- endif -%}
</div>
<h2 class="page-title">
{%- if section.settings.page.title != blank -%}
{{ section.settings.page.title | escape }}
{%- else -%}
Page title
{%- endif -%}
</h2>
<div class="rte">
{%- if section.settings.page.content != blank -%}
{{ section.settings.page.content }}
{%- else -%}
<div class='page-placeholder-wrapper placeholder'>
{{ 'page' | placeholder_svg_tag: 'page-placeholder' }}
</div>
{%- endif -%}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion sections/rich-text.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<noscript>{{ 'section-rich-text.css' | asset_url | stylesheet_tag }}</noscript>

<div class="{% unless section.settings.full_width %}page-width{% endunless %}">
<div class="rich-text color-{{ section.settings.color_scheme }} gradient{% if section.settings.full_width %} rich-text--full-width{% endif %} section-wrapper{% if section.settings.full_width %} section-wrapper--fullwidth{% endif %}">
<div class="rich-text color-{{ section.settings.color_scheme }} gradient{% if section.settings.full_width %} rich-text--full-width{% endif %}">
<div class="rich-text__blocks">
{%- for block in section.blocks -%}
{%- case block.type -%}
Expand Down
Loading