MediaWiki:Common.less/navbox.less

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

.navbox {
    font-size: .85em;
    background: @BODY_LIGHT;
    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 {
        font-size: 110%;
        background:  @BODY_DARK;
        text-align: center;
        padding: 3px 8px;

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

    }

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

    // navbox group title
    .navbox-group-title {
        background: @BODY_MID;
        border: 1px solid @BODY_DARK;
        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 @BODY_DARK;
        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: @BODY_DARK;
            padding: 0 8px;
        }

    }

    // images
    img {
        height: auto;
        width: auto;
        //max-height: 1.6em; // limit to line-height
        padding: 0 1px;
        .pixelate();
    }

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

}

.navbox-data {
	display:none;
	& + .navbox {
        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;
    }

}

.navbox-title-name-plain {
    padding-right: 6em;
}
.navbox-title-name-notplain {
    padding-right: 0;
}
.navbox-title-noname-plain {
    padding-left: 0;
}
.navbox-title-noname-notplain {
    padding-left: 6em;
}