I am looking to implement various color combinations for different tab selections using the background-color
property.
For instance:
- About: red
.nav-tabs
, dark red for.active
, - Services: yellow
.nav-tabs
, dark yellow for.active
, - ....
- ....
and so forth.
What would be the most effective way to achieve this? I have come up with a plan:
- Pre-define styles for background colors,
- Retrieve the hash on the 'shown.bs.tab' event,
- Pass it into a switch statement,
- Apply css to
.nav-tabs
and.active
.
Is there a better, more practical solution?
EDIT:
To clarify further, when I select the 'about' tab, the entire tab panel and other pills will turn red, with the active 'about' pill being dark red. If 'services' is selected, the tab panel and all pills will be yellow, with the active 'services' pill in dark yellow.