wikimedia/mediawiki-extensions-Wikibase

View on GitHub
view/resources/wikibase/wikibase.less

Summary

Maintainability
Test Coverage
/**
 * Common styles independent from JavaScript being enabled or disabled.
 *
 * @license GNU GPL v2+
 * @author H. Snater < mediawiki@snater.com >
 */

/* No point in always displaying the notification right under the search box since notifications
are also triggered down the document */
.wb-entitypage .mw-notification-area {
    position: fixed;
}

h1 .wikibase-title-id {
    color: #72777d;
    font-size: 0.6em;
    margin-left: 0.4em;
    unicode-bidi: embed;
}

/**
 * Make the title's fallback hint look the same as other fallback hints
 * This is hacky and vector-specific
 * It basically overrides MediaWiki's h1 styling with Vector's .mw-body styling
 */
.skin-vector .wikibase-title .wb-language-fallback-indicator {
    /* 0.8 (.wb-language-fallback-indicator) * 0.875 (.mw-body-content) / 1.875 (.mw-body h1) */
    font-size: 0.3888em;
    font-family: sans-serif;
    color: #202122;
}

h1 .wikibase-title-id::before {
    /* Prevent id being hidden in ellipsis on very long labels: */
    content: ' ';
}

.wb-entitypage .ui-state-disabled {
    opacity: 1;
}

.wb-entitypage .ui-state-disabled input,
.wb-entitypage input.ui-state-disabled,
.wb-entitypage .ui-state-disabled textarea {
    background-color: #f8f9fa;
    color: #54595d;
}

/* Overwrite colour for element that are in edit mode although their container element is not */
.wb-entitypage .ui-state-disabled .wb-edit input:not( .ui-state-disabled ),
.wb-entitypage .ui-state-disabled .wb-edit textarea {
    background-color: #fff;
    color: inherit;
}

/* Messages displayed while some action is performed (e.g. an API call) */
.wb-actionmsg {
    font-style: italic;
}

.ui-closeable {
    background-color: #fff;
    border-bottom: 1px solid #c8ccd1;
    border-top: 1px solid #c8ccd1;
    padding: 0.2em 10px;
    font-size: 0.9em;
}

.ui-closeable.wb-edit {
    background-color: #eaf3ff;
}

.ui-closeable.wb-error {
    background-color: #fee7e6;
}

.wikibase-copyrightnotification-container a {
    cursor: pointer;
}

.wb-clear {
    clear: both;
}

/********** BASIC LAYOUT **********/

#bodyContent {
    clear: both; /* to not overlay success message */
}

.wikibase-entityview #toc {
    display: none;
}

h2.wb-section-heading {
    position: relative;
    float: left;
    margin-bottom: 0.2em;
    margin-top: 1em;
    padding-left: 10px;
    border-bottom: 0;
    box-sizing: border-box;
    width: 100%;
}

.wikibase-entityview input {
    /* prevent browsers from applying their default styles */
    border: 1px solid #a2a9b1;
    border-radius: 0;
    box-sizing: border-box;
}

.wikibase-entityview textarea {
    font-family: inherit;
}

/* horizontal rule below the description */
.wb-hr {
    float: left;
    width: 100%;
    height: 1px;
    margin: 0;
}

.wikibase-entityview .wikibase-toolbar-container {
    position: absolute;
    right: 0;
    top: 0;
    width: 18em;
}

.wikibase-entityview .wikibase-toolbar-container > .wikibase-toolbar-container {
    position: static;
    width: auto;
}

.wb-empty {
    color: #a2a9b1;
}

.wb-entity-undefinedinfo {
    color: #54595d;
    font-style: italic;
}

.wb-placeholder-dir {
    &-rtl::placeholder {
        direction: rtl;
        text-align: right;
    }

    &-ltr::placeholder {
        direction: ltr;
        text-align: left;
    }
}

/********** /BASIC LAYOUT **********/

/********** CLAIMS **********/

div.wikibase-statementview textarea {
    margin: 0;
    box-sizing: border-box;
}

/* Section of claims referring to one property */
.wikibase-statementgrouplistview {

    @highlight-outline-width: 2px;

    .wikibase-statementlistview {
        position: relative;
        background-color: #fff;
        float: left;
        margin-left: 15em;
        width: ~'calc( 100% - 15em - @{highlight-outline-width} )';
        border: 1px solid #c8ccd1;
    }

    /* Highlight target statement groups, e.g. https://www.wikidata.org/wiki/Q42#P735 */
    :target {
        outline: @highlight-outline-width solid #36c;
    }

    /* Highlight individual target statements, e.g. https://www.wikidata.org/wiki/Q42#Q42$1d7d0ea9-412f-8b5b-ba8d-405ab9ecf026 */
    .wikibase-statementlistview .wikibase-statementview:target {
        outline: @highlight-outline-width solid #36c;
        z-index: 1;
    }

    /* Container for the section title */
    .wikibase-statementgroupview-property {
        width: 15em;
        background: #eaecf0;
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 1; /* should overlay borders of claim containers etc. */
    }

    /* The actual section title (the linked property name) */
    .wikibase-statementgroupview-property .wikibase-statementgroupview-property-label {
        float: left;
        word-wrap: break-word;
        padding: 10px;
        padding-bottom: 0; /* avoid scrollbars on multi-line property labels */
        transition: top 0.1s ease-out;
        position: sticky;
        top: 10px;
    }
}

/* A single claim */
div.wikibase-statementview {
    width: 100%;
}

/* Container for the claim contents */
div.wikibase-statementview-mainsnak {
    position: relative;
    margin-right: 18em;
    max-width: 32em;
    word-wrap: break-word;
}

div.wikibase-statementview-mainsnak .wikibase-snakview-property-container {
    display: none;
}

.wikibase-statementview.wb-new .wikibase-statementview-mainsnak .wikibase-snakview-property-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -15em;
    width: 15em;
    display: block;
    z-index: 2; /* must be above .wikibase-statementgroupview-property */
}

div.wikibase-snakview {
    padding: 10px 5px 5px 0.625rem;
}

div.wikibase-snakview .wikibase-snakview-value-container {
    margin-left: 1rem;
    min-height: 1.6em; /* reduces jumping when clicking edit */
}

.wikibase-snakview {
    .wikibase-snakview-value,
    .wikibase-snakview-indicators {
        display: inline;
    }

    .wikibase-snakview-value .valueview {
        display: inherit; /* inline from above or block from below */
    }

    &.wb-edit {
        .wikibase-snakview-value {
            display: block;
        }

        .wikibase-snakview-indicators {
            display: none;
        }
    }
}

div .wikibase-snakview-value span.error.wb-format-error {
    display: block;
    color: #f00;
    font-size: inherit;
    font-style: italic;
}

.wikibase-statementlistview > .wikibase-toolbar-wrapper {
    background-color: #eaecf0;
    display: block;
    float: left;
    position: relative;
    width: 100%;
}

.wikibase-statementlistview.wb-new > .wikibase-toolbar-wrapper {
    border-top: 0;
}

.wikibase-statementlistview > .wikibase-toolbar-wrapper .wikibase-toolbar-container {
    position: static;
    line-height: 2em;
    float: right;
}

/***** TIME VALUES *****/

.wb-calendar-name {
    font-style: italic;
    margin-left: 0.5em;
    line-height: 1;
}

/***** /TIME VALUES *****/

/***** EDIT/NEW CLAIM *****/

.wikibase-statementgrouplistview .wb-new > .wikibase-statementlistview > .wikibase-toolbar-wrapper .wikibase-addtoolbar-container {
    display: none;
}

.wikibase-statementgrouplistview .wikibase-statementgroupview-property.wb-edit,
.wikibase-statementgroupview-property.wb-edit + .wikibase-statementlistview > .wikibase-toolbar-wrapper {
    background-color: #b6c8ec;
}

.wikibase-statementgrouplistview .wikibase-statementgroupview-property.wb-error {
    background-color: #efa0a0;
}

.wikibase-statementgrouplistview .wikibase-statementview.wb-error,
.wikibase-statementgrouplistview .wikibase-statementview.wb-error .wb-claim {
    background-color: #fee7e6;
}

.wikibase-statementlistview.wb-new {
    margin-bottom: 0;
    border: 0;
}

.wikibase-statementgrouplistview .wikibase-statementlistview.wb-new .wikibase-statementview {
    border: 1px solid #c8ccd1;
    width: 100%;
    margin-bottom: 1em;
}

.wikibase-statementgrouplistview .wikibase-statementview.wb-new {
    padding-bottom: 0;
}

.wikibase-statementgrouplistview .wb-new .wikibase-statementview-mainsnak {
    margin: 0 18em 0 0;
}

.wikibase-statementgrouplistview .wb-new .wikibase-statementview-mainsnak .wikibase-snakview-property {
    padding: 10px;
}

.wikibase-statementgrouplistview .wb-new .wikibase-statementview-mainsnak .wikibase-snakview-property input {
    width: 100%;
    box-sizing: border-box;
}

.wikibase-statementgrouplistview .wb-new .wikibase-statementview-mainsnak .wikibase-snakview-value {
    min-height: 1.5em;
    max-width: 32em;
}

.wikibase-snakview-typeselector {
    position: absolute;
    left: 0.75rem;
}

.wikibase-snakview-unsupportedsnaktype,
.wikibase-snakview-variation-valuesnak-unsupporteddatavalue,
.wikibase-snakview-variation-valuesnak-datavaluetypemismatch,
.wikibase-snakview-variation-valuesnak-nonewvaluefordeletedproperty,
span.wikibase-snakview-variation-somevaluesnak,
span.wikibase-snakview-variation-novaluesnak {
    color: #54595d;
    font-style: italic;
    line-height: 1.2;
}

.wikibase-snakview-variation-valuesnak-datavaluetypemismatch,
.wikibase-snakview-variation-valuesnak-nonewvaluefordeletedproperty {
    color: #f00;
}

.wikibase-snakview-variation-valuesnak-datavaluetypemismatch-message div {
    font-size: 84%;
    margin-top: 0.4em;
}

.wikibase-snakview-variation-valuesnak textarea {
    width: 100%;
}

/***** /EDIT/NEW CLAIM *****/

/***** QUALIFIERS *****/

.wikibase-statementview-qualifiers {
    padding-left: 2em;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-property {
    width: 12em;
    position: absolute;
    font-size: 90%;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-property input {
    width: 100%;
    font-size: 100%;
    top: 0;
    position: absolute;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-value-container {
    margin-left: 12em;
    position: relative;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-body {
    margin-left: 1rem;
    margin-right: 18em;
    word-wrap: break-word;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-value .valueview-value {
    font-size: 90%;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-typeselector {
    left: 0;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-value .valueview-value textarea {
    box-sizing: border-box;
}

.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview {
    position: relative;
    line-height: 1.2;
    min-height: 1.5em;
    padding-top: 4px;
    padding-bottom: 2px;
}

/* "remove" link at each reference's snak */
.wikibase-statementview-qualifiers .wikibase-snaklistview .wikibase-snaklistview-listview .wikibase-snakview > .wikibase-toolbar-container {
    top: 5px;
}

/* "add" link in one reference's snak list */
.wikibase-statementview-qualifiers > .wikibase-toolbar-container {
    float: right;
    margin-bottom: 1em;
    position: static;
    display: none;
}

.wikibase-statementview.wb-edit .wikibase-statementview-qualifiers > .wikibase-toolbar-container {
    display: block;
}

/***** /QUALIFIERS *****/

.wikibase-statementgrouplistview > .wikibase-toolbar-container {
    float: right;
    position: static;
}

/********** /CLAIMS **********/

/********** STATEMENTS **********/

/* Container for a single statement */
.wikibase-statementview {
    border-bottom: 1px solid #eaecf0;
    float: left;
    width: 100%;
    position: relative;
    padding-bottom: 1em;
}

.wikibase-statementview:last-child {
    border-bottom: 0;
}

.wikibase-statementview .wikibase-statementview-rankselector {
    position: absolute;
    margin-left: 0.2em;
    margin-top: 10px; /* same as the .wikibase-snakview padding-top */
    z-index: 1;
}

.wikibase-statementview .wikibase-statementview-rankselector .wikibase-rankselector {
    background: none;
    border: 0;
}

.wikibase-statementview > .wikibase-toolbar {
    display: block;
}

.wikibase-statementview .wikibase-toolbar-container {
    top: 10px; /* even out padding */
    white-space: nowrap;
}

.wikibase-statementview .commons-media-caption {
    /* Same size as div.gallerytext */
    font-size: 94%;
}

.wikibase-statementview .wikibase-kartographer-caption {
    clear: both;
}

.wikibase-statementview div.thumb img,
.wikibase-statementview div.thumb audio,
.wikibase-statementview div.thumb video,
.wikibase-statementview div a.mw-kartographer-map {
    border: 1px solid #c8ccd1;
}

/***** REFERENCES *****/

.wikibase-statementview-references-heading {
    color: #72777d;
    margin-top: 0.5em;
    display: flex;
}

.wikibase-statementview-references-heading,
.wikibase-statementview-references {
    padding-left: 2em;
    clear: both;
}

/* Some UI elements are initially hidden if JS is enabled */
.client-js .wikibase-entitytermsview-entitytermsforlanguagelistview.wikibase-initially-collapsed,
.client-js body:not( .wb-diffpage ):not( .wb-oldrevpage ) .wikibase-initially-collapsed {
    display: none;
}

.wikibase-referenceview {
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
    margin-bottom: 0.5em;
}

.wikibase-referenceview .wikibase-referenceview-listview {
    padding-top: 0.3em;
}

.wikibase-referenceview .wikibase-referenceview-heading {
    min-height: 1.5em;
    padding: 5px;
    background-color: #eaecf0;
    display: none;
}

.wikibase-referenceview .wikibase-referenceview-heading .wikibase-toolbar-container {
    top: 5px;
}

.wikibase-referenceview.wb-edit {
    background-color: #eaf3ff;
}

.wikibase-referenceview.wb-edit > .wikibase-referenceview-heading {
    background-color: #b6c8ec;
    display: block;
}

.wikibase-referenceview.wb-error {
    background-color: #fee7e6;
}

.wikibase-referenceview.wb-error > .wikibase-referenceview-heading {
    background-color: #efa0a0;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-property {
    width: 12em;
    position: absolute;
    font-size: 90%;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-property input {
    width: 100%;
    font-size: 100%;
    top: 0;
    position: absolute;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-value-container {
    margin-left: 12em;
    position: relative;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-body {
    margin-left: 1rem;
    margin-right: 18em;
    word-wrap: break-word;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-value .valueview-value {
    font-size: 90%;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-typeselector {
    left: 0;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview-value-container .wikibase-snakview-value .valueview-value textarea {
    box-sizing: border-box;
}

.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview {
    position: relative;
    line-height: 1.2;
    min-height: 1.7em;
    padding-top: 0.3em;
    padding-bottom: 0.3em;
}

/* a reference's "edit" toolbar */
.wikibase-referenceview .wb-edittoolbar {
    position: absolute;
    right: 0;
    top: 0;
}

.wikibase-referenceview .wikibase-toolbar-container {
    top: 0.3em;
}

/* "remove" link at each reference's snak */
.wikibase-referenceview .wikibase-snaklistview-listview .wikibase-snakview > .wb-removetoolbar {
    position: absolute;
    top: 5px;
    right: 0;
}

/* "add" link in one reference's snak list */
.wikibase-referenceview > .wikibase-addtoolbar-container {
    float: right;
    margin-bottom: 1em;
    position: static;
}

/* "add reference" link */
.wikibase-statementview-references > .wikibase-toolbar-container {
    float: right;
    position: static;
}

/***** /REFERENCES *****/

/***** TABBED REFERENCES *****/

/* Styles for tabbed references */

/* Clear default tabs ui styling */
div.listview-item.wikibase-referenceview-tabs.ui-tabs.ui-widget.ui-widget-content {
    font-size: 100%;
    background-image: none;
    padding: 0;
    border-radius: 0;
    border: 0;
}

.wikibase-referenceview-tabs {

    /* Remove padding so snak remove button lines up with other buttons */
    div.ui-tabs-panel.ui-widget-content {
        padding-right: 0;
    }

    /* Fix position of "add" link for new snaks in one reference's snak */
    .wikibase-addtoolbar-container {
        float: right;
        margin-bottom: 1em;
        position: static;
        padding-right: 15em;
        width: auto;
    }

    /* Remove default border for tabs */
    .ui-widget-header {
        border: 0;
    }

    /* Tab link style */
    .ui-state-default > .ui-tabs-anchor {
        color: #000;
    }

    /* Active tab link text style */
    .ui-tabs-active > .ui-tabs-anchor {
        font-weight: bold;
    }

    /* Add padding around tabs */
    ul.ui-tabs-nav.ui-widget-header {
        padding-left: 10px;
        padding-top: 5px;
    }

    /* Make tabs more visually defined from div */
    li.ui-tabs.ui-tabs-nav {
        margin-left: 0.5em;
    }

    /* Style for tabs */
    li.ui-state-default {
        border: 0;
        background-color: #b6c8ec;
        background-image: none;

        /* Style for active tab */
        &.ui-tabs-active.ui-state-active {
            background-color: #eaf3ff;
        }
    }
}

/***** /TABBED REFERENCES *****/

/***** INDICATORS *****/

.wikibase-snakview-indicators .wikibase-snakview-indicator {
    margin-left: 0.5em;
}

/***** /INDICATORS *****/

/********** /STATEMENTS **********/

/********** SITE LINKS **********/

.wikibase-sitelinks {
    display: none;
}

.wb-sitelinks-heading .wikibase-sitelinkgroupview-counter {
    font-size: 67%; /* reset to standard font size */
    margin-left: 0.6em;
    line-height: 100%; /* prevent white space below heading */
}

/********** /SITE LINKS **********/

/********** PROPERTY PAGE **********/

.wb-propertypage .wikibase-propertyview-datatype {
    background-color: #f8f9fa;
    border: 1px solid #c8ccd1;
    border-collapse: separate;
    float: left;
    width: 100%;
}

.wb-propertypage .wikibase-propertyview-datatype-value {
    font-weight: bold;
    padding: 10px;
}

/********** /PROPERTY PAGE **********/

/***** DIFF VIEW *****/
table.diff table.wb-details {
    margin-left: 2em;
    line-height: 1em;
    border: 0;
    padding: 0;
}

table.diff table.wb-details th {
    font-size: 80%;
    font-weight: bold;
    text-align: left;
    padding: 0;
    border: 0;
}

table.diff table.wb-details td {
    font-size: 80%;
    font-weight: normal;
    text-align: left;
    margin: 0;
    border: 0;
}
/***** /DIFF VIEW *****/

/********** PAGE IMAGE **********/

.wikibase-pageImage {
    display: none;
    border: 1px solid #c8ccd1;
    position: relative;
    width: 100%;
    margin: 0 2em 2em 0;
}

.wikibase-pageImage .help {
    position: absolute;
    top: 5px;
    right: 0;
}

.wikibase-pageImage .help .wikibase-wbtooltip {
    text-decoration: none;
    display: block;
}

/********** /PAGEIMAGE **********/