Community Central
Community Central
(Centering (flexboxed) headers, fixing the white text on Preview)
Tag: Source edit
(this was already fixed)
Line 79: Line 79:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
or <code>'''<nowiki><h2 style="display:block; text-align:center;"></nowiki>'''</code>
 
or <code>'''<nowiki><h2 style="display:block; text-align:center;"></nowiki>'''</code>
 
 
== Fixing the white-on-white text color on Preview ==
 
<syntaxhighlight lang="css">
 
.oo-ui-dialog-content {
 
color: var(--theme-page-text-color);
 
}
 
</syntaxhighlight>
 
Source: https://community.fandom.com/f/p/4400000000003182175/r/4400000000010497121
 

Revision as of 04:39, 6 July 2021

Snippets are For FandomDesktop unless specified otherwise


Full background on FandomDesktop, using the image that was uploaded on Oasis

body.mediawiki.skin-fandomdesktop {
    background-image: url("/wiki/Special:FilePath/Wiki-background");
    background-attachment: fixed;
    background-position: center top;
}

.fandom-community-header__background::before {
    background: none;
}
  • Fits for a wide centered image. Splitted image would need a different code. Tiled or non-fixed image would need little alteration.
  • The second part is needed to remove the header gradient, which doesn't go up well with the full background image.
  • It's not clear if it is possible to upload another image under the same name once Oasis is removed, since the file has no extension. If not, it's possible to upload to another name (such as Wiki-background.png) and changing the code accordingly.


Center-aligning infobox tabs

(Credit: .krowl25)

.portable-infobox .wds-tabs__tab:first-child {
    margin-left: auto;
}

.portable-infobox .wds-tabs__tab:last-child {
    margin-right: auto;
}

or

.portable-infobox .wds-tabs__tab {
    margin: auto;
}
  • items will be spaced evenly when they are few.
  • Source, and warning not to use justify-content: center; as it will crop the beginning when the items overflow:

https://community.fandom.com/f/p/4400000000003176261/r/4400000000010457167


Multiline infobox tabs

.pi-image-collection.wds-tabber .wds-tabs {
    flex-wrap: wrap;
    justify-content: center;
}


Centering headers

Cooperating with the flexbox
.mw-parser-output h2,
.mw-parser-output h3,
.mw-parser-output h4,
.mw-parser-output h5,
.mw-parser-output h6 {
    justify-content: center;
    flex-wrap: wrap;
}

or <h2 style="justify-content:center; flex-wrap:wrap;">


Throwing away the flexbox
.mw-parser-output h2,
.mw-parser-output h3,
.mw-parser-output h4,
.mw-parser-output h5,
.mw-parser-output h6 {
    display: block;
    text-align: center;
}

or <h2 style="display:block; text-align:center;">