Skip to content

Commit

Permalink
Merge pull request #353 from Bixal/feature/BSD-349-allow-section-labe…
Browse files Browse the repository at this point in the history
…l-prefix

Feature/bsd 349 allow section label prefix
  • Loading branch information
mattsqd authored Dec 2, 2024
2 parents da4b684 + 27a99e3 commit 8af94f7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
7 changes: 7 additions & 0 deletions stories/assets/styles/global/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ h6 {
}
}

.bix-title-prefix-label {
@extend .bix-title-prefix;
border-left: none;
border-right: none;
padding: 0px;
}

dl {
line-height: 1.75;
margin-top: units(2);
Expand Down
15 changes: 12 additions & 3 deletions stories/components/section/section.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*
* Available variables:
* - prefix: Optional string. Contains title prefix with borders on the side.
* - prefix_below: Opt boolean. If true, the prefix will show under the title.
* - prefix_label: Optional string. Adds a label to prefix seperated by a |
and removes the borders from the sides.
* - heading_type: String heading type for title.
* - title: String title of section.
* - description: String body text, can include paragraphs.
Expand Down Expand Up @@ -33,12 +36,18 @@
#}
<div class="bix-container">
{% block header %}
{% if prefix_below %}
{% include "@partials/section-title.html.twig" %}
{% endif %}
{% if prefix %}
<div class="bix-title-prefix">
{{ prefix }}
<div class="bix-title-prefix{% if prefix_label %}-label{% endif %}">
{% if prefix_label %}{{ prefix_label }}&nbsp;<span aria-hidden="true">|</span>&nbsp;{% endif %}{{ prefix }}
</div>
{% endif %}
{% include "@partials/section-title.html.twig" %}
{% if not prefix_below %}
{% include "@partials/section-title.html.twig" %}
{% endif %}

{% endblock %}

{% block description %}
Expand Down
2 changes: 2 additions & 0 deletions stories/components/section/section.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default {
args: {
center_content: false,
prefix: "Who we are",
prefix_below: 0,
prefix_label: '',
heading_type: "h2",
title:
"Bixal is a diverse group of strategists, designers, engineers, and thinkers.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
heading_type: "h1",
prefix: content.field_client | field_value,
title: node.label,
prefix_below: 1,
prefix_label: 'Client',
} only %}

{% set main_body %}
Expand Down

0 comments on commit 8af94f7

Please sign in to comment.