MediaWiki:Common.less/navbox.less

From RuneScape Classic Wiki
Jump to: navigation, search
/* ===========================
       [[Template:Navbox]]
   =========================== */

@navbox-header-color: #444444;
@navbox-subheader-color: #eeeeee;
@navbox-background-color: @white;
@navbox-border-color: #cccccc;

.navbox {
    font-size: .85em;
    background: @navbox-background-color;
    border-collapse: collapse;
    margin: 15px auto;
    width: 100%;
    clear: both;

    // only main navbox, not subnavboxes
    &:not(.navbox-collapsible) {
        box-shadow: 0 2px 3px -2px rgba(0, 0, 0, 0.1);
    }

    // main header
    .navbox-title {
    	color: @white;
        font-size: 110%;
        background: @navbox-header-color;
        text-align: center;
        padding: 3px 8px;

        a {
        	color: @white;
        }

        .mw-collapsible-toggle {
            font-size: .9em;
            margin-left: 6em;
            float: right;
        }
    }

    // footer
    .navbox-footer {
        background: @navbox-header-color;
        border-top: 1px;
        text-align: center;
        font-size: smaller;
    }

    // navbox group title
    .navbox-group-title {
        background: @navbox-subheader-color;
        border: 1px solid @navbox-border-color;
        border-width: 0 1px 1px 0; // right and bottom
        font-weight: bold;
        padding-left: 10px;
        width: 15%;

        a {
            white-space: normal;
        }

    }

	// navbox group content
    .navbox-list {
        border-bottom: 1px solid @navbox-border-color;
        padding: 4px 8px;
        
        ul {
        	margin: 0;
        }

        // list styling
        li {
            display: inline-block;

            & + li::before {
                content: '• ';
            }
        }
    }

    // parent of a subgroup
    .navbox-parent {
        padding: 0;
    }

    // nested group content
    .navbox-subgroup {
        border-collapse: collapse;
        border-spacing: 0;
        width: 100%;

        // if the nested group title ever needs to be changed
        .navbox-group-title {
            // background: @BODY_LIGHT;
        }
    }

    .navbox-subgroup>tbody>tr:last-child>td {
        border-bottom: none
    }

    // nested navboxes only
    .navbox.navbox-collapsible {
        font-size: 100%;
        margin: 5px 0 0;

        .navbox-title {
            background: @navbox-header-color;
            padding: 0 8px;
        }
    }

    // images
    img {
        max-height: 1.6em;
        width: auto;
        padding: 0 1px;
    }

    // reduce gap between adjacent navboxes
    & + & {
        margin-top: -8px;
    }
}

// collapsible wikitables
// @TODO: move this out of navbox subpage
.mw-collapsible {

    &.mw-collapsed {
        min-width: 250px;
    }

    .mw-collapsible-toggle {
        font-weight: normal;
    }

}