Skip to content
Open
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
13 changes: 11 additions & 2 deletions templates/_macros/shared/vf_section_top_rule.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Helper macro to render a top rule for a section.
# Parameters:
# - top_rule_variant: string, one of "default", "muted", "highlighted", "none"
{%- macro vf_section_top_rule(top_rule_variant="default") -%}
# - top_rule_variant("default" | "muted" | "highlighted" |"none"): variant of horizontal rule to use
# - is_fixed_width(Boolean): Whether to constrain the rule by the fixed content width. Default to False.
# If you don't use this, you should wrap the rule in a .grid-row.
{%- macro vf_section_top_rule(
top_rule_variant="default",
is_fixed_width=False
) -%}
{%- set top_rule_variant = top_rule_variant | trim | lower -%}
{%- if top_rule_variant not in ["default", "muted", "highlighted", "none"] -%}
{%- set top_rule_variant = "default" -%}
Expand All @@ -23,6 +28,10 @@
{%- endif -%}
{%- endif -%}

{%- if is_fixed_width -%}
{%- set top_rule_classes = top_rule_classes + " " + "is-fixed-width" -%}
{%- endif -%}

{%- if top_rule_variant != "none" -%}
<hr class="{{- top_rule_classes -}}"/>
{%- endif -%}
Expand Down
Loading