Skip to content

Commit 878cae0

Browse files
committed
Add spacing option to Buttons Row block
1 parent 0e1eb11 commit 878cae0

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

media/css/cms/components/flare26-button.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ I propose we move to "Filled (Primary)", "Outline (Secondary)", and
295295
margin-block-end: 0;
296296
}
297297

298+
.fl-buttons.fl-buttons-spacing-small {
299+
margin-block: var(--token-layout-2xs);
300+
}
301+
302+
.fl-buttons.fl-buttons-spacing-large {
303+
margin-block: var(--token-layout-sm);
304+
}
305+
298306
.fl-tiny-icon-button {
299307
background: transparent;
300308
color: var(--fl-theme-color-link);

springfield/cms/blocks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,15 @@ def MixedButtonsBlock(
10671067

10681068

10691069
class ButtonRowBlock(blocks.StructBlock):
1070+
spacing = blocks.ChoiceBlock(
1071+
choices=[
1072+
("", "No spacing"),
1073+
("small", "Small"),
1074+
("large", "Large"),
1075+
],
1076+
default="",
1077+
required=False,
1078+
)
10701079
buttons = MixedButtonsBlock(
10711080
button_types=get_button_types(allow_uitour=False),
10721081
min_num=1,
@@ -1077,6 +1086,10 @@ class Meta:
10771086
label = "Button Row"
10781087
label_format = "Button Row"
10791088
template = "cms/blocks/button-row.html"
1089+
form_layout = blocks.BlockGroup(
1090+
children=["buttons"],
1091+
settings=["spacing"],
1092+
)
10801093

10811094

10821095
class CTASettings(blocks.StructBlock):

springfield/cms/templates/cms/blocks/button-row.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{% set block_position = block_position or "article" %}
88

9-
<div class="fl-buttons is-horizontal is-center">
9+
<div class="fl-buttons is-horizontal is-center {% if value.spacing %}fl-buttons-spacing-{{ value.spacing }}{% endif %}">
1010
{% for button in value.buttons %}
1111
{% set block_position = block_position + "." + "button-" ~ loop.index %}
1212
{% include_block button %}

0 commit comments

Comments
 (0)