Added in v5.2

View on GitHub

Title bars

Documentation and examples for Boosted’s exclusive Brand responsive title bars.

How it works

A title bar is designed to display the title of a page and shall be placed right below an Orange navbar.

Being based on spacing and backgrounds utilities, title bars were designed to take 100vw width.

See them in action in our examples page.

Background color

To change the appearance of a title bar, use our background utilities such as .bg-supporting-*.

When using title bars with the default background color, illustrations can be included as an option, but it’s not mandatory.

Supporting colors can also be used as the background color for title bars, but not the supporting light and dark tint colors. When using one of the supporting colors, illustrations must be used.

The image should not overlap on title and the title shouldn’t wrap. If this happens, please transform your title bar into a title bar with the default background color without any image.

Title

Title

html
<div class="title-bar">
  <div class="container-xxl">
    <h1 class="display-1">Title</h1>
  </div>
</div>

<div class="mt-3"></div>

<div class="bg-supporting-green title-bar" data-bs-theme="light">
  <div class="container-xxl">
    <h1 class="display-1">Title</h1>
    <picture>
      <source media="(min-width:1440px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1440.png">
      <source media="(min-width:1280px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1280.png">
      <source media="(min-width:1024px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1024.png">
      <source media="(min-width:768px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-768.png">
      <source media="(min-width:480px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-480.png">
      <source media="(min-width:320px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-320.png">
      <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-320.png" alt="">
    </picture>
  </div>
</div>

Images

Several options are available to add an image in a title bar.

srcset attribute

We strongly recommend to use srcset attribute as it is well supported by browsers and allows you to load an image depending on the user’s device. However, it might introduce a delay to display the image while resizing.

Title

html
<div class="bg-supporting-pink title-bar" data-bs-theme="light">
  <div class="container-xxl">
    <h1 class="display-1">Title</h1>
    <picture>
      <source media="(min-width:1440px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1440.png">
      <source media="(min-width:1280px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1280.png">
      <source media="(min-width:1024px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-1024.png">
      <source media="(min-width:768px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-768.png">
      <source media="(min-width:480px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-480.png">
      <source media="(min-width:320px)" srcset="/docs/5.3/assets/img/title-bars-illustrations/illustration-320.png">
      <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-320.png" alt="">
    </picture>
  </div>
</div>

HTML <svg> tag

Title

html
<div class="bg-supporting-purple title-bar" data-bs-theme="light">
  <div class="container-xxl">
    <h1 class="display-1">Title</h1>
    <svg aria-hidden="true" focusable="false" width="1.8em"><use xlink:href="/docs/5.3/assets/img/boosted-sprite.svg#file-document"/></svg>
  </div>
</div>

HTML <img> tag

Title

html
<div class="bg-supporting-green title-bar" data-bs-theme="light">
  <div class="container-xxl">
    <h1 class="display-1">Title</h1>
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-320.png" alt="" class="d-sm-none">
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-480.png" alt="" class="d-none d-sm-block d-md-none">
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-768.png" alt="" class="d-none d-md-block d-lg-none">
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-1024.png" alt="" class="d-none d-lg-block d-xl-none">
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-1280.png" alt="" class="d-none d-xl-block d-xxl-none">
    <img src="/docs/5.3/assets/img/title-bars-illustrations/illustration-1440.png" alt="" class="d-none d-xxl-block">
  </div>
</div>

Background image

To include a background image in a title bar, it is required to use the background shorthand CSS property in some extra CSS that you can see on our examples page.

CSS

Variables

Title bars use local CSS variables on .title-bar for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

--#{$prefix}title-bar-bg: #{$title-bar-bg};
--#{$prefix}title-bar-color: #{$title-bar-color};
--#{$prefix}title-bar-image-ratio: #{$title-bar-image-ratio};
--#{$prefix}title-bar-padding-y: #{$title-bar-padding-y};
--#{$prefix}title-bar-font-size: #{$title-bar-font-size};
--#{$prefix}title-bar-line-height: #{$title-bar-line-height};
--#{$prefix}title-bar-letter-spacing: #{$title-bar-letter-spacing};
--#{$prefix}title-bar-border-width: #{$title-bar-border-width};
--#{$prefix}title-bar-border-color: #{$title-bar-border-color};

Sass variables

$title-bar-bg:                      var(--#{$prefix}body-bg);
$title-bar-color:                   var(--#{$prefix}body-color);
$title-bar-image-ratio:             1.8em;
$title-bar-padding-y:               .3333333em;
$title-bar-font-size:               $h2-font-size;
$title-bar-line-height:             $display-line-height;
$title-bar-letter-spacing:          $h2-spacing;
$title-bar-border-width:            calc(var(--#{$prefix}border-width) * .5); // stylelint-disable-line function-disallowed-list
$title-bar-border-color:            var(--#{$prefix}border-color-subtle);

$title-bar-font-size-md:            $display2-size;
$title-bar-letter-spacing-md:       $display2-spacing;

$title-bar-font-size-xl:            $display1-size;
$title-bar-letter-spacing-xl:       $display1-spacing;

// fusv-disable
$title-bar-border-color-dark:       $gray-700; // Deprecated in v5.3.3
// fusv-enable