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 */ | ||
/* | /* CSS placed here will be applied to all skins */ | ||
.mw-collapsible- | mw.loader.using('jquery.makeCollapsible').then(function () { | ||
// Turn sidebar collapsibles into an accordion | |||
$('#mw-panel .mw-collapsible').on('beforeExpand.mw-collapsible', function () { | |||
// Collapse siblings when one expands | |||
$(this).siblings('.mw-collapsible').each(function () { | |||
if (!$(this).hasClass('mw-collapsed')) { | |||
$(this).find('.mw-collapsible-toggle').click(); | |||
} | |||
}); | |||
}); | |||
}); | |||
/* Style collapsible sidebar sections like dropdowns */ | |||
.mw-collapsible-toggle { | |||
float: right; | |||
font-weight: bold; | |||
cursor: pointer; | |||
} | |||
.mw-collapsible.mw-collapsed > .mw-collapsible-toggle::after { | |||
content: " ▼"; /* arrow when collapsed */ | |||
} | |||
.mw-collapsible:not(.mw-collapsed) > .mw-collapsible-toggle::after { | |||
content: " ▲"; /* arrow when expanded */ | |||
} | } | ||
/* Collapsible Sidebar Styles */ | |||
.sidebar-toggle { | |||
cursor: pointer; | |||
font-weight: bold; | |||
color: #0645ad; | |||
margin-left: 8px; | |||
font-size: 11px; | |||
user-select: none; | |||
text-decoration: none; | |||
display: inline-block; | |||
min-width: 20px; | |||
text-align: center; | |||
} | |||
.sidebar-toggle:hover { | |||
text-decoration: underline; | |||
color: #0b0080; | |||
background-color: #f8f9fa; | |||
border-radius: 2px; | |||
} | |||
/* Collapsed state styling */ | |||
#mw-panel .portal.sidebar-collapsed .body { | |||
display: none !important; | |||
} | } | ||
/* Improve sidebar section spacing */ | |||
#mw-panel .portal { | |||
margin-bottom: 0.7em; | |||
border-bottom: 1px solid #eaecf0; | |||
padding-bottom: 0.3em; | |||
} | |||
#mw-panel .portal:last-child { | |||
border-bottom: none; | |||
} | |||
/* Header styling for collapsible sections */ | |||
#mw-panel .portal h3 { | |||
cursor: default; | |||
position: relative; | |||
font-weight: bold; | |||
color: #333; | |||
} | |||
/* Body content styling */ | |||
#mw-panel .portal .body { | |||
transition: all 0.3s ease; | |||
} | |||
margin- | #mw-panel .portal .body ul { | ||
margin: 0.3em 0 0 0; | |||
padding: 0; | |||
list-style: none; | |||
} | |||
margin- | #mw-panel .portal .body li { | ||
margin: 0.2em 0; | |||
padding: 0.1em 0; | |||
line-height: 1.3; | |||
} | |||
#mw-panel .portal .body li a { | |||
color: #0645ad; | |||
text-decoration: none; | |||
display: block; | |||
padding: 2px 0; | |||
} | |||
#mw-panel .portal .body li a:hover { | |||
text-decoration: underline; | |||
background-color: #f8f9fa; | |||
border-radius: 2px; | |||
padding: 2px 4px; | |||
margin: 0 -4px; | |||
} | } | ||
/* Visual indicator for collapsible sections */ | |||
#mw-panel .portal h3:has(.sidebar-toggle) { | |||
/* | background: linear-gradient(to right, #f8f9fa 0%, transparent 100%); | ||
padding: 2px 4px; | |||
margin: 0 -4px; | |||
border-radius: 3px; | |||
} | } | ||
. | /* Responsive adjustments */ | ||
@media (max-width: 768px) { | |||
.sidebar-toggle { | |||
font-size: 14px; | |||
margin-left: 10px; | |||
} | |||
} | } |
Revision as of 14:21, 20 August 2025
/* CSS placed here will be applied to all skins */ /* CSS placed here will be applied to all skins */ mw.loader.using('jquery.makeCollapsible').then(function () { // Turn sidebar collapsibles into an accordion $('#mw-panel .mw-collapsible').on('beforeExpand.mw-collapsible', function () { // Collapse siblings when one expands $(this).siblings('.mw-collapsible').each(function () { if (!$(this).hasClass('mw-collapsed')) { $(this).find('.mw-collapsible-toggle').click(); } }); }); }); /* Style collapsible sidebar sections like dropdowns */ .mw-collapsible-toggle { float: right; font-weight: bold; cursor: pointer; } .mw-collapsible.mw-collapsed > .mw-collapsible-toggle::after { content: " ▼"; /* arrow when collapsed */ } .mw-collapsible:not(.mw-collapsed) > .mw-collapsible-toggle::after { content: " ▲"; /* arrow when expanded */ } /* Collapsible Sidebar Styles */ .sidebar-toggle { cursor: pointer; font-weight: bold; color: #0645ad; margin-left: 8px; font-size: 11px; user-select: none; text-decoration: none; display: inline-block; min-width: 20px; text-align: center; } .sidebar-toggle:hover { text-decoration: underline; color: #0b0080; background-color: #f8f9fa; border-radius: 2px; } /* Collapsed state styling */ #mw-panel .portal.sidebar-collapsed .body { display: none !important; } /* Improve sidebar section spacing */ #mw-panel .portal { margin-bottom: 0.7em; border-bottom: 1px solid #eaecf0; padding-bottom: 0.3em; } #mw-panel .portal:last-child { border-bottom: none; } /* Header styling for collapsible sections */ #mw-panel .portal h3 { cursor: default; position: relative; font-weight: bold; color: #333; } /* Body content styling */ #mw-panel .portal .body { transition: all 0.3s ease; } #mw-panel .portal .body ul { margin: 0.3em 0 0 0; padding: 0; list-style: none; } #mw-panel .portal .body li { margin: 0.2em 0; padding: 0.1em 0; line-height: 1.3; } #mw-panel .portal .body li a { color: #0645ad; text-decoration: none; display: block; padding: 2px 0; } #mw-panel .portal .body li a:hover { text-decoration: underline; background-color: #f8f9fa; border-radius: 2px; padding: 2px 4px; margin: 0 -4px; } /* Visual indicator for collapsible sections */ #mw-panel .portal h3:has(.sidebar-toggle) { background: linear-gradient(to right, #f8f9fa 0%, transparent 100%); padding: 2px 4px; margin: 0 -4px; border-radius: 3px; } /* Responsive adjustments */ @media (max-width: 768px) { .sidebar-toggle { font-size: 14px; margin-left: 10px; } }