diff --git a/releases.yml b/releases.yml
index 1dcca29ad..8e0735500 100644
--- a/releases.yml
+++ b/releases.yml
@@ -4,6 +4,14 @@
url: /docs/patterns/cta-section
status: Updated
notes: Added attrs parameter to the section element.
+ - component: Equal height row component
+ url: /docs/patterns/equal-height-row
+ status: Updated
+ notes: Update from legacy grid to 8 column grid.
+ - component: Equal heights
+ url: /docs/patterns/equal-heights
+ status: Updated
+ notes: Added support to link item titles.
- version: 4.38.0
features:
- component: Basic section
diff --git a/scss/_patterns_data-spotlight.scss b/scss/_patterns_data-spotlight.scss
index 2aa0f3500..681037c37 100644
--- a/scss/_patterns_data-spotlight.scss
+++ b/scss/_patterns_data-spotlight.scss
@@ -15,8 +15,7 @@
}
.p-data-spotlight--2-blocks .p-data-spotlight__title-col {
- // TODO: update the following after the equal height row is updated to use the new grid system
- grid-column: span 6 !important;
+ grid-column: span 4 !important;
}
}
@@ -44,7 +43,7 @@
.p-data-spotlight--2-blocks .p-data-spotlight__title-col {
// TODO: update the following after the equal height row is updated to use the new grid system
- grid-column: span 6 !important;
+ grid-column: span 4 !important;
}
}
}
diff --git a/scss/_patterns_equal-height-row.scss b/scss/_patterns_equal-height-row.scss
index 4b6b37162..108b0f9fd 100644
--- a/scss/_patterns_equal-height-row.scss
+++ b/scss/_patterns_equal-height-row.scss
@@ -22,13 +22,13 @@
Item element within an equal height row column.
*/
+@use 'sass:math';
@import 'settings';
@mixin vf-p-equal-height-row {
.p-equal-height-row,
.p-equal-height-row--wrap {
- // TODO use new 4/4/8 grid (`%vf-grid-row`)
- @extend %vf-row;
+ @extend %vf-grid-row;
position: relative;
@@ -38,20 +38,20 @@
border-top-style: solid;
border-top-width: 1px;
display: grid;
- grid-column: span $grid-columns-small;
+ grid-column: span $grid-8-columns-small;
grid-row: span 4;
grid-template-rows: subgrid;
margin-bottom: $spv--small;
position: relative;
@media screen and ($breakpoint-small <= width < $breakpoint-large) {
- grid-column: span $grid-columns-medium;
+ grid-column: span $grid-8-columns-medium;
grid-template-columns: subgrid;
// At medium size, each column item will take half of the available
// cols from the parent grid
.p-equal-height-row__item {
- grid-column: span calc($grid-columns-medium / 2);
+ grid-column: span calc($grid-8-columns-medium / 2);
}
// At medium size, position the first column item on the left of the
@@ -65,7 +65,7 @@
@media screen and (width >= $breakpoint-large) {
border: none;
- grid-column: span calc($grid-columns / 4);
+ grid-column: span calc($grid-8-columns / 4);
margin-bottom: 0;
}
}
@@ -89,7 +89,7 @@
background-color: $colors--theme--border-low-contrast;
// Row-level dividers are not visible on smaller screen sizes
display: none;
- grid-column-end: span 12;
+ grid-column-end: span $grid-8-columns;
grid-column-start: 1;
margin: auto;
@@ -129,7 +129,7 @@
.p-equal-height-row__col {
@media screen and ($breakpoint-small <= width < $breakpoint-large) {
// Fit 2 columns onto each row at medium size
- grid-column: span calc($grid-columns-medium / 2);
+ grid-column: span calc($grid-8-columns-medium / 2);
grid-template-columns: none;
.p-equal-height-row__item {
@@ -146,23 +146,30 @@
// ADVANCED GRID SUPPORT
// Support for 25-75 split on large screen size
- // TODO implement with new 4/4/8 grid (.grid-row)
+ // The equal height row has been moved to the 8-column grid, but we still support the equal height row component
+ // being placed inside legacy grid row to ensure backward compatibility, this works since the ratio of columns
+ // remains the same.
+ // This would break if legacy grid is used inside the component itself.
+ .grid-row--25-75-on-large > .grid-col,
+ .grid-row > .grid-col-6,
.row--25-75-on-large > .col,
.row > .col-9 {
& .p-equal-height-row,
& .p-equal-height-row--wrap {
@media screen and (width >= $breakpoint-large) {
- grid-template-columns: repeat(9, minmax(0, 1fr));
+ grid-template-columns: repeat(#{(math.div($grid-8-columns, 4) * 3)}, minmax(0, 1fr));
}
}
}
+ .grid-row--50-50-on-large > .grid-col,
+ .grid-row > .grid-col-4,
.row--50-50-on-large > .col,
.row > .col-6 {
& .p-equal-height-row,
& .p-equal-height-row--wrap {
@media screen and (width >= $breakpoint-large) {
- grid-template-columns: repeat(6, minmax(0, 1fr));
+ grid-template-columns: repeat(#{math.div($grid-8-columns, 2)}, minmax(0, 1fr));
}
}
}
diff --git a/templates/_macros/shared/vf_equal-heights-block.jinja b/templates/_macros/shared/vf_equal-heights-block.jinja
new file mode 100644
index 000000000..aaaefd5af
--- /dev/null
+++ b/templates/_macros/shared/vf_equal-heights-block.jinja
@@ -0,0 +1,68 @@
+{#-
+ vf_equal_heights_block
+ Renders the inner Equal Heights grid (no outer section/rows), suitable for embedding in other patterns (e.g. tab panels).
+
+ Params:
+ - items (array) (required): Each item may include 'image_html', 'title_text', 'title_link', 'description_html', and 'cta_html'.
+ - subtitle_heading_level (int) (optional): 4 or 5 (default 5) — used for item titles.
+ - highlight_images (boolean) (optional): Whether to add a subtle grey background behind images.
+ - image_aspect_ratio_small (string) (optional): "square" | "2-3" | "3-2" | "16-9" | "cinematic" | "auto" (default: "square").
+ - image_aspect_ratio_medium (string) (optional): same options as above (default: "square").
+ - image_aspect_ratio_large (string) (optional): same options as above (default: "2-3").
+-#}
+{%- macro vf_equal_heights_block(
+ items=[],
+ subtitle_heading_level=5,
+ highlight_images=false,
+ image_aspect_ratio_small="square",
+ image_aspect_ratio_medium="square",
+ image_aspect_ratio_large="2-3"
+) -%}
+
+ {%- if title_link_attrs and "href" in title_link_attrs -%} + + {%- endif -%} + {{- title -}} + {%- if title_link_attrs and "href" in title_link_attrs -%} + + {%- endif -%} +
+ {%- endif -%} ++ {{- cta | safe -}} +
+ {%- endif -%} +{{ subtitle_text }}
{%- endif -%} @@ -65,53 +68,22 @@ {%- endif -%}{{- title -}}
- {%- endif -%} -- {{- cta | safe -}} -
- {%- endif -%} -{{- cta_content -}}
diff --git a/templates/docs/examples/patterns/equal-heights/4-columns-highlighted-images.html b/templates/docs/examples/patterns/equal-heights/4-columns-highlighted-images.html index bddc80d44..8aa3d27a1 100644 --- a/templates/docs/examples/patterns/equal-heights/4-columns-highlighted-images.html +++ b/templates/docs/examples/patterns/equal-heights/4-columns-highlighted-images.html @@ -14,8 +14,8 @@ highlight_images=True, items=[ { - "title_text": "One solution, any cloud - ", + "title_text": "One solution, any cloud", + "title_link_attrs": {'href': '#', 'aria-label': 'Learn more about One solution, any cloud'}, "image_html": '
` of individual item properties. |
| items[].title_text | The title for the item. |
+| items[].title_link_attrs | Object of attributes of an anchor element to link the title of item. |
| items[].description_html | The description for the item. |
| items[].image_html | The image element for the item. |
| items[].cta_html | The call to action element for the item. |
@@ -59,6 +60,14 @@ At a minimum, you should provide a title, at least 3 items, and a title and imag
View example of the equal heights pattern
items[].title_link_attrs
+ items[].description_html