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

Add new text and overlay settings to image with text #944

Merged
merged 18 commits into from
Dec 15, 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
22 changes: 21 additions & 1 deletion assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,16 @@ blockquote {
text-transform: uppercase;
}

.caption-with-letter-spacing--medium {
font-size: 1.2rem;
letter-spacing: .16rem;
}

.caption-with-letter-spacing--large {
font-size: 1.4rem;
letter-spacing: 0.18rem;
}

.caption-large,
.customer .field input,
.customer select,
Expand Down Expand Up @@ -920,10 +930,20 @@ summary::-webkit-details-marker {
.subtitle {
font-size: 1.8rem;
line-height: calc(1 + 0.8 / var(--font-body-scale));
letter-spacing: 0.05rem;
letter-spacing: 0.06rem;
color: rgba(var(--color-foreground), 0.7);
}

.subtitle--small {
font-size: 1.4rem;
letter-spacing: 0.1rem;
}

.subtitle--medium {
font-size: 1.6rem;
letter-spacing: 0.08rem;
}

/* component-grid */
.grid {
display: flex;
Expand Down
86 changes: 84 additions & 2 deletions assets/component-image-with-text.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,92 @@
align-items: flex-start;
height: 100%;
justify-content: center;
align-self: center;
padding: 4rem calc(4rem / var(--font-body-scale)) 5rem;
}

.image-with-text__content--mobile-right > * {
align-self: flex-end;
text-align: right;
}

.image-with-text__content--mobile-center > * {
align-self: center;
text-align: center;
}

.image-with-text--overlap .image-with-text__content {
transform: translate(0 , -3rem);
Copy link
Contributor

Choose a reason for hiding this comment

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

This I think creates some extra space on mobile. Seems like using a negative margin-top makes it better: video

width: 90%;
margin: 0 auto;
}

@media screen and (min-width: 750px) {
.image-with-text__grid--reverse .image-with-text__content {
margin-left: auto;
}

.image-with-text__content--bottom {
justify-content: flex-end;
align-self: flex-end;
}

.image-with-text__content--top {
justify-content: flex-start;
align-self: flex-start;
}

.image-with-text__content--desktop-right > * {
align-self: flex-end;
text-align: right;
}

.image-with-text__content--desktop-left > * {
align-self: flex-start;
text-align: left;
}

.image-with-text__content--desktop-center > * {
align-self: center;
text-align: center;
}

.image-with-text--overlap .image-with-text__text-item {
display: flex;
padding: 3rem 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to remove this padding only at the top, only at the bottom or both depending on the desktop content position: screenshot.

Since we already have the margin on the section at the top and bottom.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still believe this is something to address to make sure we don't have unwanted space

}

.image-with-text--overlap .image-with-text__content {
height: auto;
width: calc(100% + 4rem);
min-width: calc(100% + 4rem);
transform: translate(-4rem, 0);
}

.image-with-text--overlap .image-with-text__grid--reverse .image-with-text__content {
transform: translate(4rem, 0);
}

.image-with-text--overlap .image-with-text__grid--reverse .image-with-text__text-item {
justify-content: flex-end;
}

.image-with-text--overlap .image-with-text__media-item--top {
align-self: flex-start;
}

.image-with-text--overlap .image-with-text__media-item--middle {
align-self: center;
}

.image-with-text--overlap .image-with-text__media-item--bottom {
align-self: flex-end;
}

.image-with-text__media-item--small,
.image-with-text__media-item--large + .image-with-text__text-item {
flex-grow: 0;
}
}

@media screen and (min-width: 990px) {
Expand All @@ -105,11 +184,14 @@
margin-top: 2rem;
}

.image-with-text__content > :first-child:is(.image-with-text__heading) {
.image-with-text__content > :first-child:is(.image-with-text__heading),
.image-with-text__text--caption + .image-with-text__heading,
.image-with-text__text--caption:first-child {
margin-top: 0;
}

.image-with-text__content :last-child:is(.image-with-text__heading) {
.image-with-text__content :last-child:is(.image-with-text__heading),
.image-with-text__text--caption {
margin-bottom: 0;
}

Expand Down
117 changes: 113 additions & 4 deletions locales/cs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,8 @@
"options__3": {
"label": "Velká"
},
"label": "Poměr obrázku"
"label": "Výška obrázku",
"info": "Určuje výšku sekce."
},
"color_scheme": {
"options__1": {
Expand All @@ -861,10 +862,68 @@
"label": "Obrázek jako první"
},
"options__2": {
"label": "Text jako první"
"label": "Druhý obrázek"
},
"label": "Desktopové rozvržení",
"label": "Poloha obrázku na počítači",
"info": "Výchozí mobilní rozvržení představuje možnost Obrázek jako první."
},
"desktop_image_width": {
"options__1": {
"label": "Malá"
},
"options__2": {
"label": "Střední"
},
"options__3": {
"label": "Velká"
},
"label": "Šířka obrázku na počítači",
"info": "Obrázek se automaticky optimalizuje pro mobilní prostředí."
},
"desktop_content_alignment": {
"options__1": {
"label": "Doleva"
},
"options__2": {
"label": "Na střed"
},
"options__3": {
"label": "Doprava"
},
"label": "Zarovnání obsahu na počítači"
},
"desktop_content_position": {
"options__1": {
"label": "Nahoře"
},
"options__2": {
"label": "Uprostřed"
},
"options__3": {
"label": "Dole"
},
"label": "Pozice obsahu na počítači"
},
"content_layout": {
"options__1": {
"label": "Bez překrytí"
},
"options__2": {
"label": "S překrytím"
},
"label": "Rozvržení obsahu"
},
"mobile_content_alignment": {
"options__1": {
"label": "Doleva"
},
"options__2": {
"label": "Na střed"
},
"options__3": {
"label": "Doprava"
},
"label": "Zarovnání obsahu v mobilním prostředí"
}
},
"blocks": {
Expand All @@ -873,14 +932,35 @@
"settings": {
"heading": {
"label": "Nadpis"
},
"heading_size": {
"options__1": {
"label": "Malá"
},
"options__2": {
"label": "Střední"
},
"options__3": {
"label": "Velká"
},
"label": "Velikost nadpisu"
}
}
},
"text": {
"name": "Text",
"settings": {
"text": {
"label": "Popis"
"label": "Obsah"
},
"text_style": {
"label": "Textový styl",
"options__1": {
"label": "Hlavní část"
},
"options__2": {
"label": "Podtitul"
}
}
}
},
Expand All @@ -895,6 +975,35 @@
"label": "Tlačítkový odkaz"
}
}
},
"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
Loading