Skip to content

Commit

Permalink
feat(container): add the bgColor parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 10, 2024
1 parent a65b82e commit b221430
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layouts/partials/bootstrap/container.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{- $breakpoint := "" }}
{{- $class := "" }}
{{- $bg := "" }}
{{- $bgColor := "" }}
{{- if .IsNamedParams }}
{{- $breakpoint = .Get "breakpoint" }}
{{- $class = .Get "class" }}
{{- $bg = .Get "bg" }}
{{- $bgColor = .Get "bgColor" }}
{{- else }}
{{- $breakpoint = .Get 0 }}
{{- $class = .Get 1 }}
Expand All @@ -31,6 +33,9 @@
"background-size: cover"
}}
{{- end }}
{{- with $bgColor }}
{{- $style = $style | append (printf "background-color: %s" .) }}
{{- end }}
<div
class="{{ delimit $classes ` ` }}"
{{ with $style }}{{ delimit . `;` | printf `style="%s"` | safeHTMLAttr }}{{ end }}>
Expand Down

0 comments on commit b221430

Please sign in to comment.