You can add maximum three header sections( .header-section ) that can have individual styles and behaviour.
Header sections will be defined in the following order:
.ths - for top header section
.mhs - for middle header section
.bhs - for bottom header section
<header class="header-section ths"> ... </header>
<header class="header-section mhs"> ... </header>
<header class="header-section bhs"> ... </header>
Header structure is as follows:
Each .header-section has three .header-item containers. Header-items containers can be configured individually with the help of these classes:
<header class="header-section ths">
<div class="header-content">
<div class="ui container grid">
<div class="header-item"> ... </div>
<div class="header-item"> ... </div>
<div class="header-item"> ... </div>
</div>
</div>
</header>
You can set left/right alignment, relative to the .header-item container and depending on screen resolution.
By default the .header-item elements are centered.
<header class="header-section ths">
<div class="header-content">
<div class="ui container grid">
<div class="header-item"> ... </div>
<div class="header-item flex-align-left"> ... </div>
<div class="header-item"> ... </div>
</div>
</div>
</header>
You can set the order for .header-item depending on screen resolutions.
<header class="header-section ths">
<div class="header-content">
<div class="ui container grid">
<div class="header-item flex-order-tablet-second flex-order-mobile-second">
...
</div>
<div class="header-item flex-align-left flex-order-tablet-first flex-order-mobile-first">
...
</div>
<div class="header-item flex-order-tablet-first flex-order-mobile-first"> ... </div>
</div>
</div>
</header>
You can set grow property for .header-item also by screen resolutions.
<header class="header-section ths">
<div class="header-content">
<div class="ui container grid">
<div class="header-item flex-order-tablet-second flex-order-mobile-second flex-grow-tablet-true flex-grow-mobile-true"> ... </div>
<div class="header-item flex-align-left flex-order-tablet-first flex-order-mobile-first flex-grow-large-desktop-true flex-grow-desktop-true flex-grow-tablet-false flex-grow-mobile-false"> ... </div>
<div class="header-item flex-order-tablet-first flex-order-mobile-first flex-shrink-true"> ... </div>
</div>
</div>
</header>
You can set shrink property for .header-item also by screen resolutions.
Each header section can have an unique styling by simply changing less variables from "header-section-module.less".
For example, .ths-header, we can change the following:
Background Color - changing @topHeaderSectionBackgroundColor variable
Height - changing @topHeaderSectionHeight variable
Height for Mobile - changing @topHeaderSectionHeightMobile variable
Default header width is 100% and its content width will be as long as the .container element.
Applying the .header-boxed class, header-section as well as its content will be as long as the .container element width.
Applying .header-fullwidth class, header-section as well as the content will have 100% width.
<header class="header-section ths header-boxed">
...
</header>
or
<header class="header-section mhs header-fullwidth">
...
</header>
See sample
If we apply .header-sticky class to a .header-section element, this will become sticky the moment it reaches window top.
<header class="header-section ths header-sticky">
...
</header>
Header sticky example 01
Header sticky example 02
If we apply .header-resize class to a .header-section element, this will change its height on scroll but only if the distance to Top window is greater than the scroll offset.
Warning: This option works only when used with .header-sticky class
Resizing .header-section will go from initial height (ex: @topHeaderSectionHeight) to resize height (@topHeaderSectionHeightResize).
This option has no effect on mobile.
.header-section on mobile will take the height from its mobile height variable (ex: @topHeaderSectionHeightMobile).
Scroll offset is done by changing the value of the variables: topHeaderSectionResizeOffset, middleHeaderSectionResizeOffset and bottomHeaderSectionResizeOffset and function.js .
<header class="header-section ths header-sticky header-resize">
...
</header>
Header resize example 01
Header resize example 02
If we apply .header-slide-up class to a .header-section element, the element will hide after the distance from the top will be greater than the scroll offset and will appear when scrolling up.
Warning: This option works only with .header-sticky class
This option has effect on mobile resolution too.
Slide up offset can be set by changing the value of these variables: topHeaderSectionSlideUpOffset, middleHeaderSectionSlideUpOffset and bottomHeaderSectionSlideUpOffset. from function.js .
<header class="header-section ths header-sticky header-slide-up">
...
</header>
Header slide up example 01
Header slide up example 02
If we apply .header-transparent and .is-transparent classes to a .header-section element, it will have the transparent background until top distance will be greater than the transparent scroll offset.
Warning: This works only with .header-sticky class
This option has effect on mobile resolution too.
Transparent offset can be set by changing the value of these variables: headerSectionTransparentOffset. from function.js . This offset is available for all three header sections(.ths, .mhs, .bhs)
<header class="header-section ths header-sticky header-transparent is-transparent">
...
</header>
Header transparent example 01
Header transparent example 02