Skip to content

Commit

Permalink
Add grid columns option (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman authored Feb 18, 2024
1 parent 8dcec21 commit 6434ee8
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions layouts/shortcodes/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

doc: Grids.

{{< grid >}}
{{< grid columns="1 2 2 3">}}

{{< card >}}
title = 'Only title'
Expand All @@ -25,11 +25,6 @@
'''
{{< /card >}}

{{< /grid >}}


{{< grid >}}

{{< card >}}
title = 'A card with a dropdown menu'
body = '''
Expand All @@ -46,19 +41,6 @@
link = 'https://example.com'
{{< /card >}}

{{< /grid >}}


{{< grid >}}

{{< card >}}
header = 'Header'
title = 'Card Title'
body = 'Card content'
footer = 'Footer'
{{< /card >}}


{{< card >}}
header = 'Header'
title = 'Card Title'
Expand All @@ -71,7 +53,16 @@
*/}}

<div class="sd-container-fluid sd-mb-4">
<div class="sd-row">
{{- with .Get "columns" -}}
{{ $columns := split . " " }}
{{ $xs := index $columns 0 }}
{{ $sm := index $columns 1 }}
{{ $md := index $columns 2 }}
{{ $lg := index $columns 3 }}
<div class="sd-row sd-row-cols-1 sd-row-cols-xs-{{ $xs }} sd-row-cols-sm-{{ $sm }} sd-row-cols-md-{{ $md }} sd-row-cols-lg-{{ $lg }} sd-g-2 sd-g-xs-{{ $xs }} sd-g-sm-{{ $sm }} sd-g-md-{{ $md }} sd-g-lg-{{ $lg }}">
{{- else }}
<div class="sd-row">
{{- end }}
{{ .Inner }}
</div>
</div>

0 comments on commit 6434ee8

Please sign in to comment.