Jump to content

MediaWiki:Common.css: Difference between revisions

From OSgrid Wiki
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 51: Line 51:
     text-align: center;
     text-align: center;
     border-bottom: 0;
     border-bottom: 0;
    font-size: 2.5em;
}
}


Line 164: Line 165:
  * layout preference that means nothing to someone who has come to read a
  * layout preference that means nothing to someone who has come to read a
  * page, and it clutters a menu holding two links. Hidden for the public only -
  * page, and it clutters a menu holding two links. Hidden for the public only -
  * still available when signed in. */
  * still available when signed in.
.skin-theme-clientpref-night .cdx-text-input__input,
*
.skin-theme-clientpref-night .cdx-search-input__input-wrapper {
* Scoped to Main Menu and Tools only - the Appearance box is deliberately
     background-color: #0b1626 !important;
* kept available to the public, so its own hide button must stay visible. */
.osgrid-anon #vector-main-menu .vector-pinnable-header-toggle-button,
.osgrid-anon #vector-page-tools .vector-pinnable-header-toggle-button {
     display: none !important;
}
}


Line 191: Line 195:
#userloginForm .mw-htmlform-field-HTMLInfoField {
#userloginForm .mw-htmlform-field-HTMLInfoField {
     display: none !important;
     display: none !important;
}
/* removed Mediawiki urls
.osgrid-anon #footer-icons {
      display: none;
}
*/
.osgrid-anon .osgrid-admin-only {
      display: none;
}
}

Latest revision as of 03:11, 25 October 2026

/* OSgrid wiki site styles.
 *
 * Anything under .osgrid-anon applies ONLY to readers who are not signed in.
 * Signed in as Osgridadmin none of it applies, so editing, history and the
 * Tools menu are all still there.
 *
 * The marker class comes from a small hook in LocalSettings.php - MediaWiki
 * does not otherwise say on the page whether a reader is signed in.
 */

/* Discussion: OSgrid does not use talk pages, so the tab only ever showed in
 * red, inviting people to create a page nobody wants. Hidden for everyone. */
#ca-talk,
#ca-addsection {
    display: none !important;
}

/* For the public the wiki is read only, so the page tabs are reduced to Read
 * alone. View source, View history, the overflow menu that repeats them, and
 * the Tools dropdown all go. */
/* The namespace tab and Read itself go too. For a reader there is only ever
 * one view of a page, so a row holding a single highlighted tab tells them
 * nothing and takes up space. The whole toolbar goes with them. */
.osgrid-anon #ca-nstab-main,
.osgrid-anon #ca-view,
.osgrid-anon .vector-page-toolbar,
.osgrid-anon #ca-viewsource,
.osgrid-anon #ca-history,
.osgrid-anon #ca-edit,
.osgrid-anon #ca-more-viewsource,
.osgrid-anon #ca-more-history,
.osgrid-anon #ca-more-view,
.osgrid-anon #p-cactions,
.osgrid-anon #vector-page-tools-dropdown,
.osgrid-anon .vector-page-tools-landmark,
.osgrid-anon .vector-page-tools,
.osgrid-anon #vector-page-tools {
    display: none !important;
}

/* With only one tab left, the divider beside it is pointless. */
.osgrid-anon .vector-page-toolbar .vector-page-toolbar-container > .mw-portlet-empty {
    display: none !important;
}

/* The Main Page's own top heading, centred with its rule removed. It sits
 * directly under the page title, where an underline reads as a second
 * divider rather than a section break. Only the Main Page is affected. */
.page-Main_Page #mw-content-text > .mw-parser-output > h1:first-of-type,
.page-Main_Page #mw-content-text h1 {
    text-align: center;
    border-bottom: 0;
    font-size: 2.5em;
}

/* The logo. Vector draws it at 50px; the file is 80px square, so this is the
 * largest it goes while staying perfectly sharp. Going beyond 80 would need a
 * bigger source image. */
.mw-logo-icon {
    width: 80px !important;
    height: 80px !important;
}

/* Header text in white.
 *
 * MediaWiki's dark-mode link colour is rgb(136,163,232), which reads purple
 * against the dark background. The site name and the Log in link are header
 * furniture rather than links you follow for information, so they are set to
 * white. Links inside articles keep the standard colour, since readers need to
 * recognise them as links. */
.mw-logo,
.mw-logo:visited,
.mw-logo-wordmark,
.mw-logo-container a,
#pt-login a,
#pt-login-2 a,
.vector-user-links a {
    color: #ffffff !important;
}

.mw-logo:hover,
#pt-login a:hover,
#pt-login-2 a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* The logo container carries 'invert(1) hue-rotate(180deg)' in dark mode, so
 * that a logo drawn for a light background still reads on a dark one. The
 * filter applies to the whole container, which flipped the white site name to
 * black - the text was genuinely white all along, the filter was turning it
 * over. Undoing the filter on the text, and on the icon, which already suits a
 * dark background and does not want inverting either. */
.mw-logo-container.skin-invert {
    filter: none !important;
}

/* ---------------------------------------------------------------------------
 * NAVY INSTEAD OF GREY-BLACK
 *
 * MediaWiki's dark mode uses a near-black grey. These are the same navies the
 * rebuilt website uses, so the two sites sit together:
 *
 *     #0b1626  the page behind everything
 *     #112136  raised surfaces - boxes, tables, code
 *     #102a4e  the header bar
 *
 * Only backgrounds are changed. Text, link and border colours are left to
 * MediaWiki, which sets hundreds of them and keeps them in balance.
 * ------------------------------------------------------------------------- */

html.skin-theme-clientpref-night body,
.skin-theme-clientpref-night .mw-page-container {
    background-color: #0b1626 !important;
}

/* The bar across the top, matching the website header. */
.skin-theme-clientpref-night .vector-header-container,
.skin-theme-clientpref-night .mw-header {
    background-color: #102a4e !important;
}

/* Raised surfaces: the side panels, tables, code blocks and framed boxes. */
.skin-theme-clientpref-night .vector-main-menu,
.skin-theme-clientpref-night .vector-page-tools,
.skin-theme-clientpref-night .vector-appearance,
.skin-theme-clientpref-night .vector-dropdown-content,
.skin-theme-clientpref-night .mw-table-of-contents-container,
.skin-theme-clientpref-night table.wikitable,
.skin-theme-clientpref-night table.wikitable > * > tr > th,
.skin-theme-clientpref-night pre,
.skin-theme-clientpref-night code,
.skin-theme-clientpref-night .mw-code {
    background-color: #112136 !important;
}

/* The search box sits on the header, so it needs to lift off it. */
.skin-theme-clientpref-night .cdx-text-input__input,
.skin-theme-clientpref-night .cdx-search-input__input-wrapper {
    background-color: #0b1626 !important;
}

/* The main menu, for the public only.
 *
 * Main page and Random page are kept. Two are hidden:
 *
 *   Recent changes       lists every edit to anyone who looks, which sits
 *                        oddly beside hiding View history, and tells a reader
 *                        nothing on a wiki with one editor.
 *   Help about MediaWiki leaves the site for mediawiki.org, and lands on
 *                        documentation for people who edit wikis - which
 *                        readers here cannot do.
 *
 * Both are still there when signed in. To bring either back for readers,
 * delete its line below. */
.osgrid-anon #n-recentchanges,
.osgrid-anon #n-help-mediawiki,
.osgrid-anon #n-help {
    display: none !important;
}

/* The 'move to sidebar' and 'hide' buttons on the dropdown panels.
 *
 * They let a reader pin a panel open down the side of the page. It is a
 * layout preference that means nothing to someone who has come to read a
 * page, and it clutters a menu holding two links. Hidden for the public only -
 * still available when signed in.
 *
 * Scoped to Main Menu and Tools only - the Appearance box is deliberately
 * kept available to the public, so its own hide button must stay visible. */
.osgrid-anon #vector-main-menu .vector-pinnable-header-toggle-button,
.osgrid-anon #vector-page-tools .vector-pinnable-header-toggle-button {
    display: none !important;
}

/* The rule under the page title.
 *
 * It is not a border - it is a 1px strip drawn as .vector-page-titlebar::after,
 * which is why searching for a border-bottom found nothing. With the tabs and
 * the Tools panel hidden for the public there is nothing above it to divide,
 * so it reads as a stray line. Still drawn when signed in. */
.osgrid-anon .vector-page-titlebar::after,
.osgrid-anon .mw-body-header::after {
    display: none !important;
}

/* 'Help with logging in' on the sign-in page.
 *
 * It links out to mediawiki.org's own help, which is no use to anyone here -
 * there is one account and the public cannot create one. Hidden for everyone.
 *
 * Note: setting MediaWiki:Helplogin-url to a dash does NOT remove this link in
 * 1.43, it simply points it at a page called "-". CSS is the reliable way. */
.mw-form-related-link-container,
#userloginForm .mw-htmlform-field-HTMLInfoField {
    display: none !important;
}
/* removed Mediawiki urls
.osgrid-anon #footer-icons {
      display: none;
}
*/
.osgrid-anon .osgrid-admin-only {
      display: none;
}