diff --git a/assets/scss/_custom.scss b/assets/scss/_custom.scss index 03fb7d4683665..7e844724b0dfc 100644 --- a/assets/scss/_custom.scss +++ b/assets/scss/_custom.scss @@ -1928,6 +1928,58 @@ body.td-search { color: #ffffff !important; } +body.td-home section.case-studies { + h2, h3 { + text-align: center; + } + .case-study-list { + display: flex; + flex-direction: row; + max-width: 80vw; + margin-left: auto; + margin-right: auto; + align-items: stretch; + gap: clamp(1rem, 4em, 10vw); + > .case-study-item { + display: flex; + flex-direction: column; + justify-content: space-between; + text-align: center; + width: clamp(6rem, 20%, 50vw); + picture, picture img { + height: 4.8rem; + text-align: center; + } + > a { + display: block; + text-align: right; + } + } + padding-bottom: 2em; + } + padding-top: 4rem; +} + +@media screen and (max-width: 768px) { + .case-study-list { + justify-content: center; + flex-wrap: wrap; + > .case-study-item { + min-width: 34vw; + } + } +} + +@media screen and (max-width: 650px) { + .case-study-list { + > .case-study-item { + min-width: 51vw; + } + } +} + + + // handle main page features on narrow viewports @media screen and (max-width: 768px) { .features-container div.feature-box { diff --git a/layouts/shortcodes/blocks/case-studies.html b/layouts/shortcodes/blocks/case-studies.html index 2662f22ad29e0..d490a2af51293 100644 --- a/layouts/shortcodes/blocks/case-studies.html +++ b/layouts/shortcodes/blocks/case-studies.html @@ -1,32 +1,30 @@ -{{ $caseStudiesSection := site.GetPage "case-studies" }} -{{ if not $caseStudiesSection }} +{{- $caseStudiesSection := site.GetPage "case-studies" -}} +{{- if not $caseStudiesSection -}} {{ errorf "[%s] No case-studies section found. Create content/%s/case-studies/_index.md" $.Page.Lang $.Page.Lang }} -{{ else }} +{{- else -}} {{ $caseStudiesPages := where $caseStudiesSection.Pages "Params.featured" true | first 4 }} -
-
-

{{ $caseStudiesSection.LinkTitle }}

-
- {{ range $caseStudiesPages }} +
+

{{ $caseStudiesSection.LinkTitle }}

+
+ {{- range $caseStudiesPages -}} {{ $dark := .Resources.GetMatch "**{dark_logo}*.svg" }} {{ $logo := .Resources.GetMatch "**{featured_logo}*.svg" }} {{ if not $logo }} {{ $logo = .Resources.GetMatch "**logo*.png" }} {{ end }} - {{ if not $dark }} - {{ $dark = $logo }} - {{ end }} -
+ {{- if not $dark -}} + {{ $dark = $logo }} + {{- end -}} +
- + {{ .Title }}

"{{ .Params.quote | truncate 100 }}"

{{ T "main_read_more" }}
- {{ end }} -
+ {{- end -}}
-{{ end }} +{{- end -}}