MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* CSS placed here will be applied to all skins */ | /* CSS placed here will be applied to all skins */ | ||
/* | /* | ||
LOGO | LOGO | ||
| Line 55: | Line 56: | ||
TOC - floating | TOC - floating | ||
*/ | */ | ||
/* | /* Floating TOC styling */ | ||
#toc.toc-floating { | #toc.toc-floating { | ||
position: fixed; | position: fixed; | ||
top: 80px; /* adjust for your header */ | top: 80px; /* adjust for your header */ | ||
left: 16px; /* adjust to taste */ | |||
max-height: calc(100vh - 120px); | max-height: calc(100vh - 120px); | ||
overflow | overflow: auto; | ||
z-index: 100; | z-index: 100; | ||
background: var(--mw-body-background, #fff); | background: var(--mw-body-background, #fff); | ||
padding: 0.5em 0.75em; | padding: 0.5em 0.75em; | ||
border-radius: | border-radius: 10px; | ||
box-shadow: 0 4px 16px rgba(0,0,0,0. | box-shadow: 0 4px 16px rgba(0,0,0,0.10); | ||
transition: transform 0.2s ease, opacity 0.2s ease; | |||
} | |||
/* The fold button */ | |||
#toc .toc-fold-btn { | |||
display: none; /* only show when floating (see below) */ | |||
position: sticky; | |||
top: 0; | |||
float: right; | |||
margin: 0 0 0.25em 0.5em; | |||
padding: 0.2em 0.45em; | |||
border: 1px solid rgba(0,0,0,0.15); | |||
border-radius: 8px; | |||
background: rgba(255,255,255,0.9); | |||
cursor: pointer; | |||
font-size: 12px; | |||
line-height: 1; | |||
user-select: none; | |||
} | |||
/* Show fold button only while floating */ | |||
#toc.toc-floating .toc-fold-btn { | |||
display: inline-flex; | |||
align-items: center; | |||
gap: 6px; | |||
} | |||
/* Folded state: slide TOC mostly off-screen, leave a tab visible */ | |||
#toc.toc-floating.toc-folded { | |||
transform: translateX(calc(-100% + 28px)); | |||
} | |||
/* Make the button act like a vertical tab when folded */ | |||
#toc.toc-floating.toc-folded .toc-fold-btn { | |||
float: none; | |||
position: absolute; | |||
top: 10px; | |||
right: -22px; /* pushes tab outside the TOC box edge */ | |||
transform: rotate(90deg); | |||
transform-origin: right top; | |||
} | |||
/* Optional: hide the TOC contents when folded (prevents accidental scrolling) */ | |||
#toc.toc-floating.toc-folded #toctitle, | |||
#toc.toc-floating.toc-folded ul { | |||
visibility: hidden; | |||
} | |||
/* Respect users who prefer reduced motion */ | |||
@media (prefers-reduced-motion: reduce) { | |||
#toc.toc-floating { | |||
transition: none; | |||
} | |||
} | } | ||
Revision as of 13:40, 10 February 2026
/* CSS placed here will be applied to all skins */
/*
LOGO
*/
#p-logo a { background-size: cover; }
.mw-wiki-logo { margin-top: 10px; }
/*
LANGUAGES
*/
#p-variants, #p-lang { display: none; }
/*
SIDEBAR
*/
/* Set defaults */
.emptyPortlet {
display: block;
}
.portal .vector-menu-heading {
background-image: none !important;
padding: none !important;
/* Category underline */
padding: 0.2em 0 !important;
margin: 0.5em 0.6em 0 0.66666667em !important;
border-bottom: 1px solid rgba(0, 0, 0, 0.35) !important;
}
.portal .vector-menu-content { margin: 0 0 0 0.5em !important; }
/* Category - default */
.portal .vector-menu-heading::after {
content: "▾";
margin-left: auto;
opacity: 0.6;
transition: transform 0.2s ease, opacity 0.2s ease;
}
/* Category - collapsed */
.portal.collapsed .vector-menu-heading::after {
content: "▸";
opacity: 0.4;
}
.portal.collapsed .vector-menu-heading,
.portal.collapsed .vector-menu-heading a{
color: #4d4d4d !important;
}
/* Hover effect */
.portal.collapsed .vector-menu-heading:hover,
.portal.collapsed .vector-menu-heading a:hover{
text-decoration: none !important;
}
.portal .vector-menu-heading:hover::after {
opacity: 0.85;
}
/*
TOC - floating
*/
/* Floating TOC styling */
#toc.toc-floating {
position: fixed;
top: 80px; /* adjust for your header */
left: 16px; /* adjust to taste */
max-height: calc(100vh - 120px);
overflow: auto;
z-index: 100;
background: var(--mw-body-background, #fff);
padding: 0.5em 0.75em;
border-radius: 10px;
box-shadow: 0 4px 16px rgba(0,0,0,0.10);
transition: transform 0.2s ease, opacity 0.2s ease;
}
/* The fold button */
#toc .toc-fold-btn {
display: none; /* only show when floating (see below) */
position: sticky;
top: 0;
float: right;
margin: 0 0 0.25em 0.5em;
padding: 0.2em 0.45em;
border: 1px solid rgba(0,0,0,0.15);
border-radius: 8px;
background: rgba(255,255,255,0.9);
cursor: pointer;
font-size: 12px;
line-height: 1;
user-select: none;
}
/* Show fold button only while floating */
#toc.toc-floating .toc-fold-btn {
display: inline-flex;
align-items: center;
gap: 6px;
}
/* Folded state: slide TOC mostly off-screen, leave a tab visible */
#toc.toc-floating.toc-folded {
transform: translateX(calc(-100% + 28px));
}
/* Make the button act like a vertical tab when folded */
#toc.toc-floating.toc-folded .toc-fold-btn {
float: none;
position: absolute;
top: 10px;
right: -22px; /* pushes tab outside the TOC box edge */
transform: rotate(90deg);
transform-origin: right top;
}
/* Optional: hide the TOC contents when folded (prevents accidental scrolling) */
#toc.toc-floating.toc-folded #toctitle,
#toc.toc-floating.toc-folded ul {
visibility: hidden;
}
/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
#toc.toc-floating {
transition: none;
}
}