fix: add column size attribute (#278)

This commit is contained in:
Robert Kaussow 2022-07-11 15:09:48 +02:00 committed by GitHub
parent 6a827d20f9
commit bf9cf7578a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 4 deletions

View File

@ -1,4 +1,11 @@
<div class="gblog-columns flex flex-wrap flex-mobile-column"> {{- $size := default "regular" (.Get "size" | lower) }}
{{- if not (in (slice "regular" "large" "small") $size) }}
{{- $size = "regular" }}
{{- end }}
<div class="gblog-columns gblog-columns--{{ $size }} flex flex-gap flex-mobile-column">
{{ range split .Inner "<--->" }} {{ range split .Inner "<--->" }}
<div class="gblog-columns__content gblog-markdown--nested flex-even"> <div class="gblog-columns__content gblog-markdown--nested flex-even">
{{ . | $.Page.RenderString }} {{ . | $.Page.RenderString }}

View File

@ -79,6 +79,15 @@
.flex-mobile-column { .flex-mobile-column {
flex-direction: column; flex-direction: column;
&.gblog-columns {
margin: $padding-32 0;
}
.gblog-columns__content {
min-width: auto;
margin: 0;
}
} }
.gblog-footer { .gblog-footer {

View File

@ -72,13 +72,25 @@
// {{< columns >}} // {{< columns >}}
.gblog-columns { .gblog-columns {
margin-left: -$padding-16; &--regular > :first-child {
margin-right: -$padding-16; flex: 1;
}
&--small > :first-child {
flex: 0.35;
min-width: $body-min-width * 0.35;
}
&--large > :first-child {
flex: 1.65;
min-width: $body-min-width * 1.65;
}
&__content { &__content {
flex: 1 1;
margin: $padding-16 0; margin: $padding-16 0;
min-width: $body-min-width * 0.66; min-width: $body-min-width * 0.66;
padding: 0 $padding-16; padding: 0;
} }
.gblog-post__anchor { .gblog-post__anchor {