MediaWiki:Gadget-Tabs.css

/* General notes: * The classes here are applied by JS and Lua scripts at MediaWiki:Gadget-Tabs.js and Module:UtilsLayout/Tabs, respectively. * * The > selector is used here to account for the possibility of tabs nested within tabs (e.g. Template:Media) * The different tab containers may have different styling options set, * so it's important that styles are only applied to direct children rather than all descendants */

.tabcontainer { display: flex; flex-wrap: wrap; } .tabcontainer--align-x-center { justify-content: center; } .tabcontainer--stretch > .tab { flex: 1 0 0; } .tabcontainer--columns > .tab { flex: 1 0 100%; } .tabcontainer-top { margin-top: 4px; margin-bottom: 8px; } .tabcontainer-bottom { margin-top: 8px; margin-bottom: 4px; }

.tab { min-width: fit-content; box-sizing: border-box; display: flex; justify-content: center; align-items: center; } .tab--label-align-y-bottom { align-items: flex-end; }

.tabcontents > .content { display: none; } .tabcontents > .content.content--active { display: block; }

.tabcontents--align-x-center { margin: 0 auto; } .tabcontents--align-x-center > .content { text-align: center; } .tabcontents--align-x-right { margin-left: auto; } .tabcontents--align-x-right > .content { text-align: right; }

/* No need to add class for top vertical alignment because "start" is the default CSS value for align-self */ .tabcontents--align-y-center > .content { align-self: center; } .tabcontents--align-y-bottom > .content { align-self: end; }

/* The idea behind fixed width/height is to overlap all the images one over the other, * so that the container takes on the width/height of the largest tab. */ .tabcontents--fixed-width, .tabcontents--fixed-height { display: grid; grid-template-columns: 1fr; } .tabcontents--fixed-width > .content, .tabcontents--fixed-height > .content { display: block; grid-row: 1; grid-column: 1; } .tabcontents--fixed-width > .content:not(.content--active), .tabcontents--fixed-height > .content:not(.content--active) { visibility: hidden; } .tabcontents--fixed-width:not(.tabcontents--fixed-height) > .content:not(.content--active) { height: 0; } .tabcontents--fixed-height:not(.tabcontents--fixed-width) > .content:not(.content--active) { width: 0; }

.tabcontainer .tab.explain { /* See MediaWiki:Gadget-Tooltips */ text-decoration: none; float: none; }