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

Rich text improvements #1635

Merged
merged 10 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
14 changes: 14 additions & 0 deletions assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ h5,
word-break: break-word;
}

.hxl {
font-size: calc(var(--font-heading-scale) * 5rem);
}

@media only screen and (min-width: 750px) {
.hxl {
font-size: calc(var(--font-heading-scale) * 6.2rem);
}
}

.h0 {
font-size: calc(var(--font-heading-scale) * 4rem);
}
Expand Down Expand Up @@ -553,6 +563,10 @@ table:not([class]) th {
}
}

.left {
text-align: left;
}

.center {
text-align: center;
}
Expand Down
51 changes: 28 additions & 23 deletions assets/section-rich-text.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
.rich-text {
margin-left: auto;
margin-right: auto;
text-align: center;
z-index: 1;
}

.rich-text.rich-text--full-width {
max-width: initial;
width: 100%;
}

.rich-text__blocks {
margin: auto;
/* 2.5rem margin on left & right */
.rich-text__wrapper {
display: flex;
justify-content: center;
width: calc(100% - 5rem / var(--font-body-scale));
}

.rich-text__blocks * {
overflow-wrap: break-word;
}

.rich-text--full-width .rich-text__blocks {
/* 4rem (1.5rem + 2.5rem) margin on left & right */
.rich-text:not(.rich-text--full-width) .rich-text__wrapper {
margin: auto;
width: calc(100% - 8rem / var(--font-body-scale));
}

@media screen and (min-width: 750px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to your PR but because I noticed it here, I'll leave it as a reminder for us to review this later and create an issue for this.

The setting is called Desktop content position and applies to "tablet and above" (> 750px). It looks we're consistently doing that in many other sections like Image with Text, Image Banner and others. Sounds like this is the intended behaviour.

But I just noticed that on the Product page, the Desktop layout applies to > 750px and the Desktop media size applies to > 990px. It uses the same automatically optimized for mobile description that is mentioned in the setting you just added, so I'm wondering if there are more occurrences of this inconsistency across the theme.

image

.rich-text__blocks {
max-width: 50rem;
.rich-text__wrapper {
width: 100%;
}

.rich-text__wrapper--left {
justify-content: flex-start;
}

.rich-text--full-width .rich-text__blocks {
/* 7.5rem (5rem + 2.5rem) margin on left & right */
width: calc(100% - 15rem);
.rich-text__wrapper--right {
justify-content: flex-end;
}

.rich-text__blocks {
max-width: 50rem;
}
}

Expand All @@ -42,7 +37,9 @@
}
}

/* Blocks */
.rich-text__blocks * {
overflow-wrap: break-word;
}

.rich-text__blocks > * {
margin-top: 0;
Expand All @@ -56,3 +53,11 @@
.rich-text__blocks > * + a {
margin-top: 3rem;
}

.rich-text__button {
display: inline-block;
}

.rich-text__button + .rich-text__button {
margin-left: 1rem;
}
andrewetchen marked this conversation as resolved.
Show resolved Hide resolved
57 changes: 57 additions & 0 deletions locales/cs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
},
"options__3": {
"label": "Velký"
},
"options__4": {
"label": "Extra velká"
}
}
},
Expand Down Expand Up @@ -1950,6 +1953,31 @@
"settings": {
"full_width": {
"label": "Nastavit plnou šířku sekce"
},
"desktop_content_position": {
"options__1": {
"label": "Vlevo"
},
"options__2": {
"label": "Uprostřed"
},
"options__3": {
"label": "Vpravo"
},
"label": "Pozice obsahu v počítači",
"info": "Pozice se automaticky optimalizuje pro mobilní prostředí."
},
"content_alignment": {
"options__1": {
"label": "Doleva"
},
"options__2": {
"label": "Na střed"
},
"options__3": {
"label": "Doprava"
},
"label": "Zarovnání obsahu"
}
},
"blocks": {
Expand Down Expand Up @@ -1982,6 +2010,35 @@
"label": "Použít styl tlačítka s obrysem"
}
}
},
"caption": {
"name": "Titulek",
"settings": {
"text": {
"label": "Text"
},
"text_style": {
"label": "Textový styl",
"options__1": {
"label": "Podtitul"
},
"options__2": {
"label": "Velká písmena"
}
},
"caption_size": {
"label": "Velikost textu",
"options__1": {
"label": "Malý"
},
"options__2": {
"label": "Střední"
},
"options__3": {
"label": "Velký"
}
}
}
}
},
"presets": {
Expand Down
57 changes: 57 additions & 0 deletions locales/da.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
},
"options__3": {
"label": "Stor"
},
"options__4": {
"label": "Ekstra stor"
}
}
},
Expand Down Expand Up @@ -1950,6 +1953,31 @@
"settings": {
"full_width": {
"label": "Gør afsnittet til fuld bredde"
},
"desktop_content_position": {
"options__1": {
"label": "Venstre"
},
"options__2": {
"label": "Centreret"
},
"options__3": {
"label": "Højre"
},
"label": "Placering af indhold på computer",
"info": "Placeringen optimeres automatisk til mobil."
},
"content_alignment": {
"options__1": {
"label": "Venstre"
},
"options__2": {
"label": "Centreret"
},
"options__3": {
"label": "Højre"
},
"label": "Indholdsjustering"
}
},
"blocks": {
Expand Down Expand Up @@ -1982,6 +2010,35 @@
"label": "Brug rammeknaptypografi"
}
}
},
"caption": {
"name": "Billedtekst",
"settings": {
"text": {
"label": "Tekst"
},
"text_style": {
"label": "Teksttypografi",
"options__1": {
"label": "Underoverskrift"
},
"options__2": {
"label": "Store bogstaver"
}
},
"caption_size": {
"label": "Tekststørrelse",
"options__1": {
"label": "Lille"
},
"options__2": {
"label": "Medium"
},
"options__3": {
"label": "Stor"
}
}
}
}
},
"presets": {
Expand Down
57 changes: 57 additions & 0 deletions locales/de.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
},
"options__3": {
"label": "Groß"
},
"options__4": {
"label": "Extra groß"
}
}
},
Expand Down Expand Up @@ -1950,6 +1953,31 @@
"settings": {
"full_width": {
"label": "Abschnitt über die gesamte Breite"
},
"desktop_content_position": {
"options__1": {
"label": "Links"
},
"options__2": {
"label": "Zentriert"
},
"options__3": {
"label": "Rechts"
},
"label": "Desktop-Inhaltsposition",
"info": "Positionen werden automatisch für die mobile Nutzung optimiert."
},
"content_alignment": {
"options__1": {
"label": "Links"
},
"options__2": {
"label": "Zentriert"
},
"options__3": {
"label": "Rechts"
},
"label": "Inhaltsausrichtung"
}
},
"blocks": {
Expand Down Expand Up @@ -1982,6 +2010,35 @@
"label": "Umriss-Stil für Schaltfläche verwenden"
}
}
},
"caption": {
"name": "Bildtext",
"settings": {
"text": {
"label": "Text"
},
"text_style": {
"label": "Textstil",
"options__1": {
"label": "Untertitel"
},
"options__2": {
"label": "Großbuchstaben"
}
},
"caption_size": {
"label": "Textgröße",
"options__1": {
"label": "Klein"
},
"options__2": {
"label": "Mittel"
},
"options__3": {
"label": "Groß"
}
}
}
}
},
"presets": {
Expand Down
Loading