Skip to content

Commit

Permalink
Change rich text section heading to be of type inline_richtext, also …
Browse files Browse the repository at this point in the history
…moved rte styling into base.css (Shopify#2326)
  • Loading branch information
ludoboludo authored Feb 28, 2023
1 parent efda256 commit fdb4c76
Show file tree
Hide file tree
Showing 18 changed files with 358 additions and 179 deletions.
68 changes: 68 additions & 0 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -3048,3 +3048,71 @@ details-disclosure > details {
outline: transparent solid 1px;
}
}

.rte:after {
clear: both;
content: '';
display: block;
}

.rte > p:first-child {
margin-top: 0;
}

.rte > p:last-child {
margin-bottom: 0;
}

.rte table {
table-layout: fixed;
}

@media screen and (min-width: 750px) {
.rte table td {
padding-left: 1.2rem;
padding-right: 1.2rem;
}
}

.rte img {
height: auto;
max-width: 100%;
border: var(--media-border-width) solid rgba(var(--color-foreground), var(--media-border-opacity));
border-radius: var(--media-radius);
box-shadow: var(--media-shadow-horizontal-offset) var(--media-shadow-vertical-offset) var(--media-shadow-blur-radius) rgba(var(--color-shadow), var(--media-shadow-opacity));
margin-bottom: var(--media-shadow-vertical-offset);
}

.rte ul,
.rte ol {
list-style-position: inside;
padding-left: 2rem;
}

.rte li {
list-style: inherit;
}

.rte li:last-child {
margin-bottom: 0;
}

.rte a {
color: rgba(var(--color-link), var(--alpha-link));
text-underline-offset: 0.3rem;
text-decoration-thickness: 0.1rem;
transition: text-decoration-thickness var(--duration-short) ease;
}

.rte a:hover {
color: rgb(var(--color-link));
text-decoration-thickness: 0.2rem;
}

.rte blockquote {
display: inline-flex;
}

.rte blockquote > * {
margin: -0.5rem 0 -0.5rem 0;
}
67 changes: 0 additions & 67 deletions assets/component-rte.css

This file was deleted.

1 change: 0 additions & 1 deletion sections/collapsible-content.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{ 'component-accordion.css' | asset_url | stylesheet_tag }}
{{ 'collapsible-content.css' | asset_url | stylesheet_tag }}
{{ 'component-rte.css' | asset_url | stylesheet_tag }}

{%- style -%}
.section-{{ section.id }}-padding {
Expand Down
1 change: 0 additions & 1 deletion sections/email-signup-banner.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{{ 'component-newsletter.css' | asset_url | stylesheet_tag }}
{{ 'newsletter-section.css' | asset_url | stylesheet_tag }}
{{ 'section-email-signup-banner.css' | asset_url | stylesheet_tag }}
{{ 'component-rte.css' | asset_url | stylesheet_tag }}

{%- style -%}
#Banner-{{ section.id }}::after {
Expand Down
2 changes: 0 additions & 2 deletions sections/featured-collection.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-rte.css' | asset_url | stylesheet_tag }}

<link rel="stylesheet" href="{{ 'component-slider.css' | asset_url }}" media="print" onload="this.media='all'">
<link rel="stylesheet" href="{{ 'template-collection.css' | asset_url }}" media="print" onload="this.media='all'">
Expand Down Expand Up @@ -48,7 +47,6 @@

<div class="color-{{ section.settings.color_scheme }} isolate gradient">
<div class="collection section-{{ section.id }}-padding{% if section.settings.full_width %} collection--full-width{% endif %}">

<div class="collection__title title-wrapper title-wrapper--no-top-margin page-width{% if show_mobile_slider %} title-wrapper--self-padded-tablet-down{% endif %}{% if show_desktop_slider %} collection__title--desktop-slider{% endif %}">
{%- if section.settings.title != blank -%}
<h2 class="title inline-richtext {{ section.settings.heading_size }}">{{ section.settings.title }}</h2>
Expand Down
15 changes: 12 additions & 3 deletions sections/featured-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{{ 'section-featured-product.css' | asset_url | stylesheet_tag }}
{{ 'component-accordion.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-rte.css' | asset_url | stylesheet_tag }}
{{ 'component-loading-overlay.css' | asset_url | stylesheet_tag }}

{%- style -%}
Expand Down Expand Up @@ -284,9 +283,19 @@
{% assign share_url = product.selected_variant.url | default: product.url | prepend: request.origin %}
{% render 'share-button', block: block, share_link: share_url %}
{%- when 'variant_picker' -%}
{% render 'product-variant-picker', product: product, block: block, product_form_id: product_form_id, update_url: false %}
{% render 'product-variant-picker',
product: product,
block: block,
product_form_id: product_form_id,
update_url: false
%}
{%- when 'buy_buttons' -%}
{%- render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id -%}
{%- render 'buy-buttons',
block: block,
product: product,
product_form_id: product_form_id,
section_id: section.id
-%}
{%- when 'custom_liquid' -%}
{{ block.settings.custom_liquid }}
{%- when 'rating' -%}
Expand Down
Loading

0 comments on commit fdb4c76

Please sign in to comment.