MediaWiki:Common.css: Difference between revisions
From GDPRhub
(Update style of headings. Also allow applying heading styles on any element (although not recommended)) |
(Changes for updated “New on GDPRhub” list) |
||
Line 164: | Line 164: | ||
- MediaWiki:Common.css to style the items as cards | - MediaWiki:Common.css to style the items as cards | ||
*/ | */ | ||
#new-on-gdprhub | ul#new-on-gdprhub { | ||
list-style: none; | list-style: none; | ||
margin-left: 0; | margin-left: 0; | ||
Line 176: | Line 176: | ||
max-width: 100%; | max-width: 100%; | ||
flex-grow: 1; | flex-grow: 1; | ||
transition: opacity 0.5s; | |||
} | } | ||
#new-on-gdprhub li a { | #new-on-gdprhub li a { | ||
Line 187: | Line 188: | ||
overflow: hidden; | overflow: hidden; | ||
color: inherit; | color: inherit; | ||
position:relative; | position:relative; | ||
display: flex; | display: flex; | ||
Line 194: | Line 194: | ||
#new-on-gdprhub li .card-text { | #new-on-gdprhub li .card-text { | ||
flex-grow: 1; | flex-grow: 1; | ||
font-size: 0.8em; | |||
} | } | ||
#new-on-gdprhub li .card-image { | #new-on-gdprhub li .card-image { | ||
Line 209: | Line 210: | ||
align-self: center; | align-self: center; | ||
} | } | ||
#new-on-gdprhub li | #new-on-gdprhub li:not(.preview-loaded) { | ||
opacity: 0.2; | opacity: 0.2; | ||
} | } | ||
#new-on-gdprhub li .card-title { | #new-on-gdprhub li .card-title { | ||
Line 222: | Line 217: | ||
} | } | ||
#new-on-gdprhub li .card-description { | #new-on-gdprhub li .card-description { | ||
} | } | ||
#new-on-gdprhub li .preview-loaded::after { | #new-on-gdprhub li.preview-loaded a::after { | ||
content: '→ Read more'; | content: '→ Read more'; | ||
font-size: 0.8rem; | font-size: 0.8rem; |
Revision as of 13:13, 26 July 2021
/* CSS placed here will be applied to all skins */
/* Load the Lato font files (only defines the @font-face; the ‘Timeless’ skin applies it to the document) */
@import '/resources/assets/fonts/lato/stylesheet.css';
/* noyb colors */
.color-middle {
background: #9c0a7d;
}
.color-left {
background: #9c0a7d;
}
.color-right {
background: #9c0a7d;
}
.mw-body h1.firstHeading {
border-bottom: solid 4px #9c0a7d;
}
.tools-inline li.selected {
border-bottom: solid 4px #9c0a7d;
}
a.new, .new a {
color: #9c0a7d;
}
/* Text/Headline font sizes */
body {
font-size: 0.875em;
}
.mw-body h1, .h1 {
font-size: 1.8em;
}
.mw-body h2, .h2 {
font-size: 1.6em;
}
.mw-body h3, .h3 {
font-size: 1.4em;
border-bottom: solid 1px #c8ccd1;
}
.mw-body h4, .h4 {
font-size: 1.2em;
font-weight: bold;
}
.mw-body h5, .h5 {
font-style: italic;
}
/* Copy styles from normal h1, h2, … for our ‘fake’ headings */
.h1, .h2, .h3, .h4, .h5, .h6 {
font-weight: normal;
font-family: 'Linux Libertine','Times New Roman','Liberation Serif','Nimbus Roman','Noto Serif','Times',serif;
line-height: 1.125;
margin: 1.25em 0 0.5em;
}
.h1::after,
.h2::after {
content: '';
display: block;
border-bottom: solid 2px #c8ccd1;
overflow: hidden;
}
/* No title on welcome page; see https://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_hide_the_main_page_title? */
body.page-Welcome_to_GDPRhub.action-view h1.firstHeading,
body.page-Welcome_to_GDPRhub.action-submit h1.firstHeading {
display: none;
}
p {
text-align: justify;
text-justify: auto;
}
/* Table of contents */
html body .mw-body .toc {
/* Don’t show ToC in a box */
display: block;
border: unset;
background: unset;
box-shadow: unset;
padding: unset;
margin: unset;
min-width: unset;
}
html body .mw-body .toctitle h2 {
/* Undo special styling for “Contents” h2 (apply same styles as for normal h2) */
display: block;
font-size: 1.6em;
font-family: 'Linux Libertine','Times New Roman','Liberation Serif','Nimbus Roman','Noto Serif','Times',serif;
line-height: 1.125;
margin: 1.25em 0 0.5em;
}
html body .mw-body .toctitle {
border-bottom: none; /* put border under h2 (not div) to not touch floating box */
}
html body .mw-body .toctitle h2::after {
display: block; /* put border under h2 (not div) to not touch floating box */
}
/*html body .mw-body .toc > ul {*/
/* For links to headings, use font of headings */
/*font-family: 'Linux Libertine','Times New Roman','Liberation Serif','Nimbus Roman','Noto Serif','Times',serif;*/
/*line-height: 1.125;*/
/*font-size: 1.1em;*/
/*}*/
html body .mw-body .toctogglespan {
/* No hide/show button */
display: none;
}
/* mobile/desktop specific media queries */
/* make content tables at beginning of articles prettier */
@media screen and (max-width: 850px) {
.wikitable {
width: 100% !important;
float: left;
/* display: none; */
}
}
/* display element desktop/mobile only */
@media screen and (max-width: 850px) {
.desktop-only {
display: none;
}
}
@media screen and (min-width: 850px) {
.mobile-only {
display: none;
}
}
/* For making two column layout on front page */
.split-box {
display: flex;
flex-flow: row wrap;
gap: 2em;
}
.split-box-left,
.split-box-right {
width: 30em;
max-width: 100%;
flex-grow: 1;
}
/* “New on GDPRhub” list on main page
Functionality defined by multiple pieces:
- the NewPages extension
- MediaWiki:Common.js to load the content to preview
- relies on OpenGraphMeta+Description2 extensions to provide those contents
- MediaWiki:Common.css to style the items as cards
*/
ul#new-on-gdprhub {
list-style: none;
margin-left: 0;
display: flex;
flex-flow: row wrap;
gap: 2em;
justify-content: space-evenly;
}
#new-on-gdprhub li {
width: 20em;
max-width: 100%;
flex-grow: 1;
transition: opacity 0.5s;
}
#new-on-gdprhub li a {
box-sizing: border-box;
width: 100%;
height: 11rem;
padding: 1.2rem;
border: 1px solid lightgrey;
border-radius: 4px;
box-shadow: 2px 2px 4px #33333333;
overflow: hidden;
color: inherit;
position:relative;
display: flex;
flex-flow: row nowrap;
}
#new-on-gdprhub li .card-text {
flex-grow: 1;
font-size: 0.8em;
}
#new-on-gdprhub li .card-image {
width: 100px;
flex-shrink: 0;
margin-left: 1em;
display: flex;
align-content: center;
}
#new-on-gdprhub li .card-image img {
width: 100%;
height: auto;
max-height: 100%;
max-width: 100%;
align-self: center;
}
#new-on-gdprhub li:not(.preview-loaded) {
opacity: 0.2;
}
#new-on-gdprhub li .card-title {
margin-top: 0;
}
#new-on-gdprhub li .card-description {
}
#new-on-gdprhub li.preview-loaded a::after {
content: '→ Read more';
font-size: 0.8rem;
display: block;
position: absolute;
bottom:0;
left: 0;
width: 100%;
padding: 1.2rem 0 0.2rem 1.2rem;
background: linear-gradient(transparent, #ffffffee 50%);
}
/* Style the “most active contributors” table on the main page */
.contributionscores {
border: none;
}
.contributionscores td:nth-child(1),
.contributionscores th:nth-child(1),
.contributionscores td:nth-child(2),
.contributionscores th:nth-child(2) {
/* Hide rank & score columns */
display: none;
}
.contributionscores tbody {
display: block;
max-height: 40em;
overflow-y: auto;
overflow-x: hidden; /* prevents horizontal scrollbar in Chromium */
position: relative;
}
.contributionscores tr.header {
/* Keep column headers visible */
position: sticky; /* Not working in Chromium. whatever. */
top: 0;
}
.contributionscores tr.header th {
border: none;
}
.contributionscores-title {
display: none;
}
/* We use sitenotice/localnotice to show the banner image (if any) */
#localNotice {
border: none;
background: none;
box-shadow: none;
text-align: center;
}
#localNotice p,
.random-banner-container p {
margin: 0;
text-align: center;
}
.random-banner-container img {
width: auto !important;
height: auto !important;
max-height: 100px !important;
}
.random-banner-container {
height: 100px; /* Fix height to avoid things move when the banner loads */
overflow: hidden;
transition: opacity 0.2s;
}
.random-banner-container:not(.ready) {
opacity: 0;
}
.random-banner-container:not(.ready) > * {
display: none;
}