Since it is a portable infobox, you will have to create an
infobox theme for each color. So, if you would want to have option to have overall infobox colored red, blue, or yellow, then following code should be added on your wiki's
CSS:
.portable-infobox.pi-theme-red {
background:red;
}
.portable-infobox.pi-theme-blue {
background:blue;
}
.portable-infobox.pi-theme-yellow {
background:yellow;
}
If you want to have the title and headers colored accordingly as well, then add this, too:
.pi-theme-red .pi-title {
background:deeppink;
}
.pi-theme-red .pi-header {
background:deeppink;
}
.pi-theme-blue .pi-title {
background:lightblue;
}
.pi-theme-blue .pi-header {
background:lightblue;
}
.pi-theme-yellow .pi-title {
background:gold;
}
.pi-theme-yellow .pi-header {
background:gold;
}
(You can go ahead and replace the colors with your needed ones from the both codes above if you want.)
And, in the
infobox template, add
<infobox theme-source="color">
in the place of
<infobox>
.
Once done, if you want the infobox to be colored yellow on a certain page, you would simply need to add
|color = yellow
in the infobox:
{{Infobox Railway
|color = yellow
}}
I hope you get the idea. ^^