Jump to content

MediaWiki:Citizen.css: Difference between revisions

From The Petit Planet Wiki
Fixed sidebar styling from appearing on smaller screens
Applied mobile skin fixes
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* All CSS here will be loaded for users of the Citizen skin */
/* All CSS here will be loaded for users of the Citizen skin */
/* Disable image hover transformation */
:root {
:root {
     --transform-image-hover: none;
     --transform-image-hover: none;
}
}


:root.skin-theme-clientpref-day,
/* Adjust --color-destructive */
:root.skin-theme-clientpref-night {
:root.skin-theme-clientpref-night {
     --color-surface-0: var(--page-background-color);
     --color-destructive__h: 360;
     --color-surface-1: var(--theme-color-1);
     --color-destructive__l: 67%;
    --color-surface-2: var(--theme-color-2);
}
     --color-surface-3: var(--theme-color-3);
 
     --color-surface-4: var(--theme-color-4);
@media screen and (prefers-color-scheme: dark) {
     --color-base: var(--page-text-color);
    .skin-theme-clientpref-os {
    --color-destructive__h: 360;
        --color-destructive__l: 67%;
     }
}
 
/* Disable extra midnight theme */
#skin-client-prefs-citizen-feature-pure-black {
    display: none !important;
}
 
/* Background image handling */
/* Adapted from: https://tolkiengateway.net/ */
:root {
    --background-image: none;
}
 
@media screen {
     .skin-theme-clientpref-night .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/b/b4/Background_Dark.jpg);
        background-position: 70% center;
    }
    .skin-theme-clientpref-day .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/c/c3/Background_Light.jpg);
        background-position: 70% center;
     }
}
 
@media screen and (prefers-color-scheme: dark) {
    .skin-theme-clientpref-os .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/b/b4/Background_Dark.jpg);
        background-position: 70% center;
    }
}
}


:root.skin-theme-clientpref-night {
.citizen-page-container,
     --color-destructive__h: 360;
.citizen-body-container {
     --color-destructive__l: 67%;
    position: relative;
}
 
.citizen-page-container {
    background-color: var(--color-surface-0);
}
 
.citizen-page-container::before,
.citizen-body-container::after {
     content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}
 
.citizen-page-container::before {
    background-repeat: no-repeat;
}
 
.citizen-page-container::before {
    height: 240px;
    background-size: cover;
    mask-image: linear-gradient(
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.01) 66%,
        transparent 100%
    );
     -webkit-mask-image: linear-gradient(
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.01) 66%,
        transparent 100%
    );
}
 
/* Transparent body container for main page */
.rootpage-Main_Page .citizen-body {
    background: transparent;
}
 
/* Adjust wordmark height */
img.mw-logo-wordmark {
    height: 2rem;
}
}


Line 23: Line 97:
}
}


.citizen-body {
/* Remove identation of lists inside wikitables and portable infoboxes */
     background-color: var(--color-surface-0);
.wikitable, .portable-infobox {
     border-radius: var(--border-radius-large);
    ol, ul {
     margin-top: 0;
    margin-bottom: 0;
    margin-left: 1.6em;
    margin-right: 0;
    -webkit-margin-start: 1.6em;
    -webkit-margin-end: 0;
     margin-inline-start: 1.6em;
    margin-inline-end: 0;
    padding: 0;
    }
}
 
/* Wikitable fixes */
.wikitable {
    border-collapse: separate;
}
}


.citizen-body {
.citizen-overflow-wrapper:has(.citizen-overflow-content > .wikitable) {
    padding: var(--padding-page);
    box-shadow: none;
}
}


@media screen and (min-width: 1119px) {
/* Reduce border from mbox */
     #citizen-sidebar-lastmod,
.mbox {
    #citizen-toc {
     border-width: 1px;
        background-color: var(--color-surface-0);
        border-radius: var(--border-radius-large);
        padding: calc(0.5*var(--space-unit));
    }
}
}


.citizen-toc .citizen-menu__heading,
/* Move quotation marks inside box for mobile users */
.citizen-toc-contents {
.pull-quote__text p:after {
     background-color: var(--color-surface-0);
     bottom: -16px;
}
}

Latest revision as of 11:11, 18 November 2025

/* All CSS here will be loaded for users of the Citizen skin */
/* Disable image hover transformation */
:root {
    --transform-image-hover: none;
}

/* Adjust --color-destructive */
:root.skin-theme-clientpref-night {
    --color-destructive__h: 360;
    --color-destructive__l: 67%;
}

@media screen and (prefers-color-scheme: dark) {
    .skin-theme-clientpref-os {
    	--color-destructive__h: 360;
        --color-destructive__l: 67%;
    }
}

/* Disable extra midnight theme */
#skin-client-prefs-citizen-feature-pure-black {
    display: none !important; 
}

/* Background image handling */
/* Adapted from: https://tolkiengateway.net/ */
:root {
    --background-image: none;
}

@media screen {
    .skin-theme-clientpref-night .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/b/b4/Background_Dark.jpg);
        background-position: 70% center;
    }
    .skin-theme-clientpref-day .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/c/c3/Background_Light.jpg);
        background-position: 70% center;
    }
}

@media screen and (prefers-color-scheme: dark) {
    .skin-theme-clientpref-os .citizen-page-container:before {
        background-image: url(https://petitplanet.wiki/images/b/b4/Background_Dark.jpg);
        background-position: 70% center;
    }
}

.citizen-page-container,
.citizen-body-container {
    position: relative;
}

.citizen-page-container {
    background-color: var(--color-surface-0);
}

.citizen-page-container::before,
.citizen-body-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.citizen-page-container::before {
    background-repeat: no-repeat;
}

.citizen-page-container::before {
    height: 240px;
    background-size: cover;
    mask-image: linear-gradient(
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.01) 66%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.01) 66%,
        transparent 100%
    );
}

/* Transparent body container for main page */
.rootpage-Main_Page .citizen-body {
    background: transparent;
}

/* Adjust wordmark height */
img.mw-logo-wordmark {
    height: 2rem;
}

h2, h3 {
    font-weight: var(--font-weight-normal);
}

/* Remove identation of lists inside wikitables and portable infoboxes */
.wikitable, .portable-infobox {
    ol, ul {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 1.6em;
    margin-right: 0;
    -webkit-margin-start: 1.6em;
    -webkit-margin-end: 0;
    margin-inline-start: 1.6em;
    margin-inline-end: 0;
    padding: 0;
    }
}

/* Wikitable fixes */
.wikitable {
    border-collapse: separate;
}

.citizen-overflow-wrapper:has(.citizen-overflow-content > .wikitable) {
    box-shadow: none;
}

/* Reduce border from mbox */
.mbox {
    border-width: 1px;
}

/* Move quotation marks inside box for mobile users */
.pull-quote__text p:after {
    bottom: -16px;
}