Navigation
Header(oben am Bildschirmrand)
Die Metanavigation erstreckt sich über die gesamte Fensterbreite und
verschwindet beim Scrollen.
Der Navigationszettel hingegen bleibt am oberen Fensterrand stehen
und ist jederzeit sichtbar.
Bei Mobiles ( < 768 pixel ) verschwindet die Metanavigation und der
Navigationszettel tritt an seinen Platz.
Der Inhalt der Metanavigation ist dann im Menu aufgelistet.
Nav Tabs
Nav Tabs werden einerseits mit statischen links realisiert.
Ein Beispiel hierfür ist die Navigationsleiste des Styleguides oben.
Eine Weitere Anwendung ist die Steuerung eines Carousels, wie das folgende Beispiel zeigt
HTML
SCSS
JS
<ul class= "indicator nav nav-tabs" >
<li class= "nav-item" >
<a href= "#" class= "nav-link active" data-target= "#my-carousel" data-slide-to= "0" title= "Seite 1" >
1
</a>
</li>
<li class= "nav-item" >
<a href= "#" class= "nav-link" data-target= "#my-carousel" data-slide-to= "1" title= "Seite 2" >
2
</a>
</li>
<li class= "nav-item" >
<a href= "#" class= "nav-link" data-target= "#my-carousel" data-slide-to= "2" title= "Seite 3" >
3
</a>
</li>
<li class= "nav-item" >
<a href= "#" class= "nav-link" data-target= "#my-carousel" data-slide-to= "3" title= "Seite 4" >
4
</a>
</li>
<li class= "nav-item" >
<a href= "#" class= "nav-link" data-target= "#my-carousel" data-slide-to= "4" title= "Seite 5" >
5
</a>
</li>
</ul>
<div id= "my-carousel" class= "carousel slide" data-ride= "carousel" data-interval= "false" >
<div class= "carousel-inner" >
<div class= "carousel-item active" >
<div class= "alert py-5" > Seite 1</div>
<div class= "nav-buttons" >
<a class= "btn btn-fixed-height btn-outline-secondary no-box-shadow text-nowrap px-3 px-sm-5 my-1"
href= "#my-carousel" role= "button" data-slide= "prev" >
<span class= "d-none d-sm-inline" >
zurück
</span>
<span class= "d-inline d-sm-none" >
<i class= "icn-pfeil-links icn-center" style= "position:relative;top:1px;" ></i>
</span>
</a>
<a class= "btn btn-fixed-height btn-secondary no-box-shadow text-nowrap px-5 my-1 ml-auto"
href= "#my-carousel" role= "button" data-slide= "next" >
Weiter
</a>
</div>
</div>
<div class= "carousel-item" >
<div class= "alert py-5" > Seite 2</div>
<div class= "nav-buttons" >
<a class= "btn btn-fixed-height btn-outline-secondary no-box-shadow text-nowrap px-3 px-sm-5 my-1"
href= "#my-carousel" role= "button" data-slide= "prev" >
<span class= "d-none d-sm-inline" >
zurück
</span>
<span class= "d-inline d-sm-none" >
<i class= "icn-pfeil-links icn-center" style= "position:relative;top:1px;" ></i>
</span>
</a>
<a class= "btn btn-fixed-height btn-secondary no-box-shadow text-nowrap px-5 my-1 ml-auto"
href= "#my-carousel" role= "button" data-slide= "next" >
Weiter
</a>
</div>
</div>
<div class= "carousel-item" >
<div class= "alert py-5" > Seite 3</div>
<div class= "nav-buttons" >
<a class= "btn btn-fixed-height btn-outline-secondary no-box-shadow text-nowrap px-3 px-sm-5 my-1"
href= "#my-carousel" role= "button" data-slide= "prev" >
<span class= "d-none d-sm-inline" >
zurück
</span>
<span class= "d-inline d-sm-none" >
<i class= "icn-pfeil-links icn-center" style= "position:relative;top:1px;" ></i>
</span>
</a>
<a class= "btn btn-fixed-height btn-secondary no-box-shadow text-nowrap px-5 my-1 ml-auto"
href= "#my-carousel" role= "button" data-slide= "next" >
Weiter
</a>
</div>
</div>
<div class= "carousel-item" >
<div class= "alert py-5" > Seite 4</div>
<div class= "nav-buttons" >
<a class= "btn btn-fixed-height btn-outline-secondary no-box-shadow text-nowrap px-3 px-sm-5 my-1"
href= "#my-carousel" role= "button" data-slide= "prev" >
<span class= "d-none d-sm-inline" >
zurück
</span>
<span class= "d-inline d-sm-none" >
<i class= "icn-pfeil-links icn-center" style= "position:relative;top:1px;" ></i>
</span>
</a>
<a class= "btn btn-fixed-height btn-secondary no-box-shadow text-nowrap px-5 my-1 ml-auto"
href= "#my-carousel" role= "button" data-slide= "next" >
Weiter
</a>
</div>
</div>
<div class= "carousel-item" >
<div class= "alert py-5" > Seite 5</div>
<div class= "nav-buttons" >
<a class= "btn btn-fixed-height btn-outline-secondary no-box-shadow text-nowrap px-3 px-sm-5 my-1"
href= "#my-carousel" role= "button" data-slide= "prev" >
<span class= "d-none d-sm-inline" >
zurück
</span>
<span class= "d-inline d-sm-none" >
<i class= "icn-pfeil-links icn-center" style= "position:relative;top:1px;" ></i>
</span>
</a>
<a class= "btn btn-fixed-height btn-secondary no-box-shadow text-nowrap px-5 my-1 ml-auto"
href= "#my-carousel" role= "button" data-slide= "next" >
Weiter
</a>
</div>
</div>
</div>
</div>
.nav-tabs {
margin-bottom : 1rem ;
.nav-link {
padding : 0 .4rem 0 .6rem ;
border-top-left-radius : 0 .25rem ;
border-top-right-radius : 0 .25rem ;
font-size : 0 .9rem ;
font-weight : bold ;
}
.nav-item :not ( :first-child ) {
margin-left : 0 .35rem ;
}
.nav-item.tab-has-errors .nav-link {
// border-top-color: rgba($danger, 0.1);
// border-right-color: rgba($danger, 0.1);
// border-left-color: rgba($danger, 0.1);
color : $danger ;
& .active {
// border-top-color: $danger;
// border-right-color: $danger;
// border-left-color: $danger;
color : $danger ;
}
}
}
.nav-buttons {
display : flex ;
align-items : end ;
justify-content : space-between ;
.nav-button {
@include media-breakpoint-down ( md ) {
@include button-size ( $btn-padding-y-sm , $btn-padding-x-sm , $btn-font-size-sm , $btn-line-height-sm , $btn-border-radius-sm );
}
}
}
@include media-breakpoint-up ( lg ) {
.nav-tabs {
padding-left : 0 .6rem ;
.nav-link {
padding : 0 .4rem 0 .8rem ;
}
}
}
$ ( document ). ready ( function (){
$ ( ' #my-carousel ' ). on ( ' slid.bs.carousel ' , function () {
$ ( ' .indicator .nav-link ' ). removeClass ( " active " );
var currentIndex = $ ( ' #my-carousel div.active ' ). index ();
$ ( " .indicator " ). find ( " [data-slide-to=' " + currentIndex + " '] " ). addClass ( " active " );
})
});
Step Bar
Die Steps Bar wird für mehrseitige Formulare verwendet.
Das CSS ist weitgehend unabhängig von Bootstrap.
HTML
SCSS
<div class= "steps-bar" >
<div class= "step-item" >
<i class= "step-item-icon" ></i>
<div class= "step-item-text" > Berechnen</div>
</div>
<div class= "step-item active" >
<i class= "step-item-icon" ></i>
<div class= "step-item-text" > Kompensieren</div>
</div>
<div class= "step-item" >
<i class= "step-item-icon" ></i>
<div class= "step-item-text" > Bezahlen</div>
</div>
</div>
.steps-bar {
display : flex ;
justify-content : space-between ;
margin-top : auto ;
margin-bottom : 24px ;
.step-item {
position : relative ;
display : flex ;
flex : 1 ;
flex-direction : column ;
align-items : center ;
color : $info ;
font-size : 1rem ;
font-weight : bold ;
// connection line to left
& ::before {
position : absolute ;
z-index : 2 ;
top : 1em ;
left : calc ( -50% + 1em );
width : calc ( 100% - 2em );
border-bottom : 2px solid $info ;
content : '' ;
}
.step-item-icon {
position : relative ;
z-index : 5 ;
display : flex ;
width : 2em ;
height : 2em ;
align-items : center ;
justify-content : center ;
border : 2px solid $info ;
margin-bottom : 6px ;
border-radius : 50% ;
& ::after {
position : absolute ;
z-index : 2 ;
content : '\e839' ;
font-family : 'myclimate-icons' ;
font-size : 1 .3em ;
font-style : normal ;
}
}
& :first-child::before {
content : none ;
}
& .active {
color : $black ;
font-weight : bold ;
.step-item-icon {
border-width : 3px ;
& ::after {
// width: 1.2rem;
// height: 1.2rem;
width : 2rem ;
height : 2rem ;
background-color : $info ;
border-radius : 50% ;
content : '' ;
}
}
// uncompleted items:
~ .step-item {
color : #CCCCCC ;
& ::before {
border-color : #CCCCCC ;
}
.step-item-icon {
border-color : #CCCCCC ;
& ::after {
content : none ;
}
}
}
}
}
@include media-breakpoint-down ( sm ) {
.step-item {
font-size : 0 .8rem ;
& .active .step-item-icon ::after {
// width: 1rem;
// height: 1rem;
width : 1 .6rem ;
height : 1 .6rem ;
}
}
}
@include media-breakpoint-down ( xs ) {
display : none ;
}
}