Skip to content

Instantly share code, notes, and snippets.

@tiesont
Forked from bjcull/nav-wizard.bootstrap.css
Last active February 20, 2018 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiesont/5b291c8344944f22c3d67cb902464048 to your computer and use it in GitHub Desktop.
Save tiesont/5b291c8344944f22c3d67cb902464048 to your computer and use it in GitHub Desktop.
Wizard style navigation tabs for bootstrap, updated for Bootstrap 4. Demo: https://jsfiddle.net/dss1mjqf/
.nav-pills.nav-wizard > li
{
position: relative;
overflow: visible;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
}
.nav-pills.nav-wizard > li + li
{
margin-left: 0;
}
.nav-pills.nav-wizard > li:first-child
{
border-left: 0;
}
.nav-pills.nav-wizard > li:first-child a
{
border-radius: 5px 0 0 5px;
}
.nav-pills.nav-wizard > li:last-child
{
border-right: 0;
}
.nav-pills.nav-wizard > li:last-child a
{
border-radius: 0 5px 5px 0;
}
.nav-pills.nav-wizard > li a
{
border-radius: 0;
background-color: #eee;
}
.nav-pills.nav-wizard > li:not(:last-child) a:after
{
position: absolute;
content: "";
top: 0px;
right: -20px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 20px 0 20px 20px;
border-color: transparent transparent transparent #eee;
z-index: 150;
}
.nav-pills.nav-wizard > li:not(:first-child) a:before
{
position: absolute;
content: "";
top: 0px;
left: -20px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 20px 0 20px 20px;
border-color: #eee #eee #eee transparent;
z-index: 150;
}
.nav-pills.nav-wizard > li:hover:not(:last-child) a:after
{
border-color: transparent transparent transparent #aaa;
}
.nav-pills.nav-wizard > li:hover:not(:first-child) a:before
{
border-color: #aaa #aaa #aaa transparent;
}
.nav-pills.nav-wizard > li:hover a
{
background-color: #aaa;
color: #fff;
}
.nav-pills.nav-wizard > li:not(:last-child) a.active:after
{
border-color: transparent transparent transparent #428bca;
}
.nav-pills.nav-wizard > li:not(:first-child) a.active:before
{
border-color: #428bca #428bca #428bca transparent;
}
.nav-pills.nav-wizard > li a.active
{
background-color: #428bca;
}
@FritzHerbers
Copy link

Thx for the BS4 update.

Noticed the following glitch:
disabled link/pills should not show their background changed when hovered:

    .nav-pills.nav-wizard > li:hover:not(:last-child) a:not(.disabled):after
    {
        border-color: transparent transparent transparent #aaa;
    }

    .nav-pills.nav-wizard > li:hover:not(:first-child) a:not(.disabled):before
    {
        border-color: #aaa #aaa #aaa transparent;
    }

    .nav-pills.nav-wizard > li:hover a:not(.disabled)
    {
        background-color: #aaa;
        color: #fff;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment