MediaWiki:Common.less/infobox.less

From Old School RuneScape Wiki
Jump to: navigation, search
// <pre>
/* ====================
       infoboxes
   ==================== */

@infobox-background: @BODY_LIGHT;
@infobox-header-color: @BODY_DARK;
@infobox-border-color: @BODY_BORDER;
@infobox-header-border: .5em solid @infobox-background;
@infobox-subheader-color: @BODY_DARK;

.infobox {
    background: @infobox-background;
    border: 1px solid @infobox-border-color;
    font-size: .85em;
    width: 300px; // fixed size so image always fills entire width
    margin: .5em 0 1em 1em;
    border-collapse: collapse;
    box-shadow: @box-shadow;
    float: right;
    table-layout: fixed;
    word-break: break-word;

    .infobox-header {
        color: @black;
        font-size: 1.15em;
        line-height: 1.4em;
        background: @infobox-header-color;
        padding: .5em 0;
        white-space: normal;

        a {
            color: @black;
            font-size: 1.15em;
            font-weight: bold;
        }
    }

    .infobox-subheader {
        background: @infobox-subheader-color;
        color: @black;
        line-height: 2em;

        a {
            color: @black;
        }

        &+.infobox-subheader {
            border-left: 0.175em solid @BODY_LIGHT;
        }
    }

    .infobox-image {
        text-align: center;

        // for inventory icon in infobox item
        &.inventory-image {
            height: 32px; // functions as min-height
        }

        // keep infobox images from sticking together
        a.image + a.image {
            margin-left: .1em;
        }

        img {
            max-width: 300px;
            height: auto;
        }
    }

    // browsers get your shit together https://caniuse.com/#feat=css-not-sel-list
    th:not(.infobox-header):not(.infobox-subheader):not(.infobox-nested) {
        text-align: right;
        vertical-align: top;
        border-right: .175em solid @infobox-subheader-color;
        padding: 0.2em 0.5em;
    }

    th {
    	white-space: nowrap;
    }

    td {
        padding: 0.25em 0.5em;
        line-height: 1.6em;

        &.infobox-nested {
            padding: 0.25em 0;
            line-height: 1em;
        }
    }

    .infobox-padding {
        height: 0.5em;
        padding: 0;
        border: 0;
    }

    .infobox-nested {
        text-align: center;

        &+.infobox-nested {
            border-left: 0.175em solid @infobox-subheader-color;
        }
    }

    .infobox-cell-hidden {
        display: none;
    }

    .infobox-template-links {
        text-align: center;
    }

    .infobox-full-width-content {
        max-width: 300px;
        text-align: center;
        overflow: hidden;
        padding: 0;
    }
    
    .infobox-caption {
        font-weight: bold;
    }
    
    &.skill-info {
    	float: none;
    	margin: 0 0 1em 0;
    }
    .infobox-media-player {
    	overflow: visible;
    }
}


/* =============================
      infobox-specific styles
   ============================= */

.infobox-item {
    th {
        width: 75px;
    }
    .infobox-image {
        .pixelate()
    }
}

.infobox-bonuses {
    clear: left;
    float: none;
    word-break: break-word;
    font-size: 100%;

    .infobox-bonuses-image {
        width: 125px;
        text-align: center;
        vertical-align: middle;
        border: 1px solid @infobox-border-color;
    }

    .infobox-bonuses-image-caption {
        font-size: 0.85em;
    }

    .infobox-subheader {
        width: 250px;
    }

    a {
        font-weight: bold;
    }
}

// (dirty trick) Hide a silly bug in switch infoboxes:
// switching between versions where there is a Quantity box followed by text will cause the text to be duplicated on switch
// This currently only occurs where the text consists of "? (edit)" links, so hiding consecutive edit links works to hide this
// This should ideally be fixed for real though, instead of just hiding it.
.skill-info a[href$="?action=edit"] + a[href$="?action=edit"] {
	display: none;
}

// Infobox Room door layout
.poh-room {
    background-color: #CCC;
    margin: auto;
    width: 100px;
    
    img {
        display: block;	
    }
}

.poh-room-row {
    display: flex;
}

.poh-room-text {
    margin: auto;
    width: 92px;
}

// [view] and [talk] links
.infobox-bottom-links {
    clear: right;
    float: right;
    font-size: xx-small;
    margin-top: -1.5em;
}

// switch infobox buttons
.infobox-buttons {
    text-align: center;
    max-width: 300px;
    display: none;

    .button {
        margin: 0 3px;
    }

}

.infobox-switch-resources {
    display:none;
}

/* infobox bonuses switch buttons */
.switch-infobox {
    .switch-infobox-triggers,
    .loading-button {
        clear: left;
    }
}

/* Infobox Pure max hit items */
.infobox-pure .max-hit-list {
	list-style: none;
	margin-left: 0;
}
.infobox-pure .max-hit-list a {
	display: inline-block;
	min-width: 32px;
	min-height: 32px;
	text-align: center;
}

// Hides advanced data. Class gets replaced by .advanced-data-display
// if the showAdvancedData gadget is enabled.
.advanced-data {
    display: none;
}

// [[Template:Multi Infobox]] styles
.multi-infobox {
	float: right;
	margin-left: 5px;
	
	.tabber {
		margin: 0;
		
		.tabbernav {
			text-align: center;
			margin: 0;

			a {
			    padding: 0.5em 0.8em;
			}
		}

		.tabbertab {
			padding: 5px;
		}
	}

	.infobox {
		margin: 0;
	}
}