diff --git a/package.json b/package.json index 8bdc3453a..778960c58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vanilla-framework", - "version": "4.38.0", + "version": "4.39.0", "author": { "email": "webteam@canonical.com", "name": "Canonical Webteam" diff --git a/releases.yml b/releases.yml index 7c5f9f113..1dcca29ad 100644 --- a/releases.yml +++ b/releases.yml @@ -1,3 +1,9 @@ +- version: 4.39.0 + features: + - component: CTA section + url: /docs/patterns/cta-section + status: Updated + notes: Added attrs parameter to the section element. - version: 4.38.0 features: - component: Basic section diff --git a/templates/_macros/vf_cta-section.jinja b/templates/_macros/vf_cta-section.jinja index 2a3ff07f3..57314185e 100644 --- a/templates/_macros/vf_cta-section.jinja +++ b/templates/_macros/vf_cta-section.jinja @@ -13,6 +13,7 @@ # title_text: H2 title text - optional # variant: default # layout: 100 + # attrs: A dictionary of attributes to apply to the section element # Slots: # cta: The cta link - required @@ -46,7 +47,7 @@ # description: Paragraph-style (one or more) content below the title - Optional # cta: Call-to-action block (required) -{%- macro vf_cta_section(title_text, variant='default', layout='100', caller=None) -%} +{%- macro vf_cta_section(title_text, variant='default', layout='100', caller=None, attrs={}) -%} {% set description_content = caller('description') %} {% set has_description = description_content|trim|length > 0 %} {% set cta_content = caller('cta') %} @@ -88,7 +89,13 @@ {%- endif -%} {%- endmacro -%}
-
+
{%- if layout == "25-75" -%}
{{ _cta_variant() }}
diff --git a/templates/docs/examples/patterns/cta-section/default-full-width.html b/templates/docs/examples/patterns/cta-section/default-full-width.html index 663f2832b..c3fe22724 100644 --- a/templates/docs/examples/patterns/cta-section/default-full-width.html +++ b/templates/docs/examples/patterns/cta-section/default-full-width.html @@ -8,6 +8,7 @@ title_text='The quick brown fox jumps over the lazy dog', variant='default', layout='100', + attrs={'id': 'full-width-default'} ) -%} {%- if slot == 'cta' -%} The quick brown fox jumps over the lazy dog › diff --git a/templates/docs/patterns/cta-section/index.md b/templates/docs/patterns/cta-section/index.md index 7c65bc7ce..4f713e7ef 100644 --- a/templates/docs/patterns/cta-section/index.md +++ b/templates/docs/patterns/cta-section/index.md @@ -149,6 +149,23 @@ The `vf_cta_section` Jinja macro can be used to generate a CTA section pattern. h2 title text + + + attrs + + + No + + + <Object> + + + N/A + + + Attributes to apply to the CTA section. See attribute forwarding docs for more info. + +