Template:OOOInfoBoxTabber/styles.css: Difference between revisions
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
/* OOO Infobox – Tabber wrapper | /* OOO Infobox – Tabber wrapper | ||
- Default width matches .ooo-infobox (300px) | - Default width matches .ooo-infobox (300px) | ||
- | - Tabs fill full width (equal columns) | ||
- | - Hides any separator line drawn by themes/extensions | ||
*/ | */ | ||
.ooo-infobox-tabwrap { | .ooo-infobox-tabwrap { | ||
float: right; | float: right; | ||
clear: right; | clear: right; | ||
width: 300px; /* keep in sync with .ooo-infobox */ | width: 300px; /* keep in sync with .ooo-infobox */ | ||
margin: 0 0 1em 1em; | |||
} | } | ||
/* | /* alignment overrides (set by module |align=...) */ | ||
.ooo-infobox-tabwrap--left { float: left; clear: left; margin: 0 1em 1em 0; } | .ooo-infobox-tabwrap--left { float:left; clear:left; margin:0 1em 1em 0; } | ||
.ooo-infobox-tabwrap--none { float: none; | .ooo-infobox-tabwrap--none { float:none; margin:0 0 1em 0; } | ||
.ooo-infobox-tabwrap--center { float: none; display: block; margin: 0 auto 1em; } | .ooo-infobox-tabwrap--center { float:none; display:block; margin:0 auto 1em; } | ||
/* | /* TAB STRIP — full-width equal tabs */ | ||
.ooo-infobox-tabwrap .tabber__tabs { | .ooo-infobox-tabwrap .tabber__tabs { | ||
display: | display: flex; | ||
flex-wrap: nowrap; /* keep in one row; change to wrap if you prefer */ | |||
gap: .25rem; | |||
margin: 0 0 .5rem 0; | |||
width: 100%; | width: 100%; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
border: 0; /* kill any normal border */ | |||
background-image: none; /* kill image-based lines */ | |||
position: relative; /* for the overlay below */ | |||
} | } | ||
/* Individual tabs */ | /* Overlay to MASK any stubborn baseline drawn by skins */ | ||
.ooo-infobox-tabwrap .tabber__tabs::after { | |||
content: ""; | |||
position: absolute; | |||
left: 0; right: 0; | |||
bottom: -1px; /* sits on top of baseline */ | |||
height: 2px; /* just enough to cover */ | |||
background: var(--background-color-base, #ffffff); /* page bg (handles dark) */ | |||
} | |||
/* Individual tabs – make them share the width equally */ | |||
.ooo-infobox-tabwrap .tabber__tab { | .ooo-infobox-tabwrap .tabber__tab { | ||
flex: 1 1 0; | |||
min-width: 0; /* allow shrinking without overflow */ | |||
text-align: center; | |||
display: inline-block; | display: inline-block; | ||
font-weight: 700; | font-weight: 700; | ||
font-size: 90%; | font-size: 90%; | ||
line-height: 1.2; | line-height: 1.2; | ||
white-space: normal; | white-space: normal; | ||
padding: . | padding: .2rem .5rem; | ||
text-decoration: none; | text-decoration: none; | ||
background: var(--background-color-neutral, #f5f5f5); | background: var(--background-color-neutral, #f5f5f5); | ||
color: var(--color-base, #202122); | color: var(--color-base, #202122); | ||
border: 1px solid #a2a9b1; /* literal | border: 1px solid #a2a9b1; /* literal avoids TemplateStyles warnings */ | ||
border-bottom: none; /* | border-bottom: none; /* blends into panel */ | ||
border-radius: 6px 6px 0 0; | border-radius: 6px 6px 0 0; | ||
} | } | ||
/* Active tab | /* Active tab blends; slight overlap hides any seam with the panel */ | ||
.ooo-infobox-tabwrap .tabber__tab--active { | .ooo-infobox-tabwrap .tabber__tab--active { | ||
background: var(--background-color-base, #ffffff); | background: var(--background-color-base, #ffffff); | ||
Line 49: | Line 69: | ||
} | } | ||
/* Panels | /* Panels */ | ||
.ooo-infobox-tabwrap .tabber__panel { | .ooo-infobox-tabwrap .tabber__panel { | ||
padding: 0; | padding: 0; | ||
Line 56: | Line 76: | ||
} | } | ||
/* | /* MOBILE */ | ||
@media (max-width: 640px) { | @media (max-width: 640px) { | ||
.ooo-infobox-tabwrap, | .ooo-infobox-tabwrap, | ||
Line 66: | Line 86: | ||
margin: 0 0 1em 0; | margin: 0 0 1em 0; | ||
} | } | ||
/* on mobile you might prefer wrapping instead of equal-width squeeze: */ | |||
.ooo-infobox-tabwrap .tabber__tabs { flex-wrap: wrap; } | |||
.ooo-infobox-tabwrap .tabber__tab { flex: 1 1 auto; } | |||
} | } |