Individually styled tabs
The tabs - by default - have a tasteful and neutral styling.
To add an extra class to a tab (for styling purposes), you can use add a class
parameter:
{tab title="My Title" class="myclass"}
Color Classes
Tabs' stylesheet comes with styling for the classes blue
, green
, orange
, red
and grey
.
Blue
Aenean commodo ligula eget dolor. Aenean massa.
Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Green
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim.
Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="Default"} [TEXT] {tab title="Blue" class="blue"} [TEXT] {tab title="Green" class="green"} [TEXT] {tab title="Orange" class="orange"} [TEXT] {tab title="Red" class="red"} [TEXT] {tab title="Grey" class="grey"} [TEXT] {/tabs}
Bootstrap Classes
You can also use the Bootstrap classes primary
, info
, success
, warning
and danger
/ error
.
Warning
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim.
Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="Primary" class="primary"} [TEXT] {tab title="Info" class="info"} [TEXT] {tab title="Success" class="success"} [TEXT] {tab title="Warning" class="warning"} [TEXT] {tab title="Danger" class="danger"} [TEXT] {/tabs}
Solid Colors
Tabs comes with ready-to-use solid
and color_content
classes you can combine with the above mentioned color and state classes:
Colored Content
Aenean commodo ligula eget dolor. Aenean massa.
Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Solid & Colored Content
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim.
Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="Solid" class="blue solid"} [TEXT] {tab title="Colored Content" class="green color_content"} [TEXT] {tab title="Solid & Colored Content" class="orange solid color_content"} [TEXT] {tab title="Just Color" class="red"} [TEXT] {/tabs}
Custom styling
If you have sufficient CSS knowledge you can also add your own classnames and styling via CSS.
Take a look at the stylesheet that comes with Tabs in: /media/tabs/css/style.css
You can overrule the Tabs stylesheet by copying it or creating your own in: /templates/[YOUR TEMPLATE]/css/tabs/style.min.css
That way you can fully customize the styling of the tabs.
Please note that the css in the style.min.css
is compressed (minified). To get the not-minified css, look in the style.css
. But Tabs will load the file name style.min.css
, regardless of whether the css inside that file is minified or not.
The original LESS files are included in the /media/tabs/less
folder.
Here are 2 examples of what you can do.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="First Tab" class="mystyle1"} [TEXT] {tab title="Second Tab" class="mystyle2"} [TEXT] {/tabs}
Here is the custom css used for these classes.
/* Custom Style: mystyle1 */ .rl_tabs.top > ul.nav > li.mystyle1 > a { -webkit-transition-duration: 0s; -moz-transition-duration: 0s; -o-transition-duration: 0s; transition-duration: 0s; font-size: 22px; background-color: #ffc2c2; background-image: -moz-linear-gradient(top, #ff9999, #ffffff); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ff9999), to(#ffffff)); background-image: -webkit-linear-gradient(top, #ff9999, #ffffff); background-image: -o-linear-gradient(top, #ff9999, #ffffff); background-image: linear-gradient(to bottom, #ff9999, #ffffff); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff9999', endColorstr='#ffffffff', GradientType=0); background-color: #ffffff; } .rl_tabs.top > ul.nav > li.mystyle1 > a:hover { background-color: #c2c2ff; background-image: -moz-linear-gradient(top, #9999ff, #ffffff); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#9999ff), to(#ffffff)); background-image: -webkit-linear-gradient(top, #9999ff, #ffffff); background-image: -o-linear-gradient(top, #9999ff, #ffffff); background-image: linear-gradient(to bottom, #9999ff, #ffffff); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff9999ff', endColorstr='#ffffffff', GradientType=0); background-color: #ffffff; } .rl_tabs.top > ul.nav > li.mystyle1.active > a, .rl_tabs.top > ul.nav > li.mystyle1.active > a:hover { background-color: #c2ffc2; background-image: -moz-linear-gradient(top, #99ff99, #ffffff); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#99ff99), to(#ffffff)); background-image: -webkit-linear-gradient(top, #99ff99, #ffffff); background-image: -o-linear-gradient(top, #99ff99, #ffffff); background-image: linear-gradient(to bottom, #99ff99, #ffffff); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff99ff99', endColorstr='#ffffffff', GradientType=0); background-color: #ffffff; } .rl_tabs.top > .tab-content > .tab-pane.mystyle1 { background-color: #f5fff5; background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#ccffcc)); background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #ccffcc); background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #ccffcc); background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #ccffcc); background-image: linear-gradient(#ffffff, #ffffff 25%, #ccffcc); background-repeat: no-repeat; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffccffcc', GradientType=0); } /* Custom Style: mystyle2 */ .rl_tabs.top > ul.nav > li.mystyle2 > a { -webkit-transition-duration: 1s; -moz-transition-duration: 1s; -o-transition-duration: 1s; transition-duration: 1s; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; -webkit-border-radius: 0 0 0 0; -moz-border-radius: 0 0 0 0; border-radius: 0 0 0 0; margin-left: 10px; margin-right: 10px; padding: 8px 20px; background-color: #aaa; color: #fff; border-color: #666; border-bottom-color: #ddd; } .rl_tabs.top > ul.nav > li.mystyle2 > a:hover { background-color: #999; border-color: #666; } .rl_tabs.top > ul.nav > li.mystyle2.active > a, .rl_tabs.top > ul.nav > li.mystyle2.active > a:hover { -webkit-border-radius: 0 30px 0 0; -moz-border-radius: 0 30px 0 0; border-radius: 0 30px 0 0; background-color: #666; border-color: #666; } .rl_tabs.top > .tab-content > .tab-pane.mystyle2 { font-family: Monaco, Menlo, Consolas, "Courier New", monospace; background-color: #666; color: #fff; }
Styling the tab title
Tabs allows you to style the title you place in the {tab} tag - right inside the tag. So you can make it bold or another font or even place images in there.