MediaWiki:Common.css: Difference between revisions

From SZ
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 */
/* Collapsible elements */
/* CSS placed here will be applied to all skins */


.mw-collapsible-arrowtoggle {
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();
            }
        });
    });
});


  background-image: url('https://upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png'); /* @noflip */
/* Style collapsible sidebar sections like dropdowns */
.mw-collapsible-toggle {
    float: right;
    font-weight: bold;
    cursor: pointer;
}


  background-position: left center;
.mw-collapsible.mw-collapsed > .mw-collapsible-toggle::after {
 
    content: " ▼"; /* arrow when collapsed */
  /* Add other styles as desired for the toggle arrow */
}


.mw-collapsible:not(.mw-collapsed) > .mw-collapsible-toggle::after {
    content: " ▲";  /* arrow when expanded */
}
}


.mw-collapsible-toggle-collapsed.mw-collapsible-arrowtoggle {


  background-image: url('https://upload.wikimedia.org/wikipedia/commons/1/1e/MediaWiki_Vector_skin_left_arrow.png'); /* @noflip */
/* 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;
}


  /* Add other styles for the collapsed state of the arrow */
.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;
}


/* Adjustments for the toggle link */
#mw-panel .portal:last-child {
    border-bottom: none;
}


.mw-collapsible span.mw-collapsible-toggle {
/* Header styling for collapsible sections */
#mw-panel .portal h3 {
    cursor: default;
    position: relative;
    font-weight: bold;
    color: #333;
}


     float: left;
/* Body content styling */
#mw-panel .portal .body {
     transition: all 0.3s ease;
}


     margin-left: 0;
#mw-panel .portal .body ul {
     margin: 0.3em 0 0 0;
    padding: 0;
    list-style: none;
}


     margin-right: 1em;
#mw-panel .portal .body li {
     margin: 0.2em 0;
    padding: 0.1em 0;
    line-height: 1.3;
}


     /* This example floats the toggle left and adjusts margins */
#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) {
/* Hide the content within collapsed sections */
    background: linear-gradient(to right, #f8f9fa 0%, transparent 100%);
 
    padding: 2px 4px;
.mw-collapsible-content {
     margin: 0 -4px;
 
    border-radius: 3px;
     display: none;
 
}
}


.mw-collapsible-toggle-expanded .mw-collapsible-content {
/* Responsive adjustments */
 
@media (max-width: 768px) {
    display: block;
    .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;
    }
}