Skip to content

Commit

Permalink
Fix word breaks (#1271)
Browse files Browse the repository at this point in the history
* Add word-break to headings

* Remove usage of hyphens css property due to unpredictability

* Change collection card heading to h3 style instead of h1
  • Loading branch information
KaichenWang authored Jan 26, 2022
1 parent 94c4a40 commit bafe4f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ h5,
letter-spacing: calc(var(--font-heading-scale) * 0.06rem);
color: rgb(var(--color-foreground));
line-height: calc(1 + 0.3 / max(1, var(--font-heading-scale)));
word-break: break-word;
}

.h0 {
Expand Down
2 changes: 0 additions & 2 deletions assets/component-image-with-text.css
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,11 @@

.image-with-text__heading {
word-break: break-word;
hyphens: auto;
margin-bottom: 0;
}

.image-with-text__text p {
word-break: break-word;
hyphens: auto;
margin-top: 0;
margin-bottom: 1rem;
}
Expand Down
4 changes: 2 additions & 2 deletions snippets/card-collection.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{%- endif -%}
<div class="card__content">
<div class="card__information">
<h3 class="card__heading h1">
<h3 class="card__heading">
<a href="{{ card_collection.url }}" class="full-unstyled-link">
{%- if card_collection.title != blank -%}
{{- card_collection.title | escape -}}
Expand All @@ -82,7 +82,7 @@
{% if settings.card_style == 'card' or card_collection.featured_image %}
<div class="card__content">
<div class="card__information">
<h3 class="card__heading{% if card_collection.featured_image == nil %} h1{% endif %}">
<h3 class="card__heading">
<a href="{{ card_collection.url }}" class="full-unstyled-link">
{%- if card_collection.title != blank -%}
{{- card_collection.title | escape -}}
Expand Down

0 comments on commit bafe4f3

Please sign in to comment.