Module:Infobox/styles.css: Difference between revisions

From IxWiki
Jump to navigation Jump to search
No edit summary
wp>Jdlrobson
For completeness.. use table-row-group for tbody element
Line 1: Line 1:
.infobox {
/* {{pp|small=y}} */
/* In case if tooltips go out of boundary */
/*
overflow: visible;
* This TemplateStyles sheet deliberately does NOT include the full set of
width: 100%;
* infobox styles. We are still working to migrate all of the manual
max-width: 400px;
* infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
margin-top: 0;
* DO NOT ADD THEM HERE
margin-bottom: var( --space-md );
*/
background: var( --color-surface-2 );
/*
border-radius: var( --border-radius--medium );
* not strictly certain these styles are necessary since the modules now
border-spacing: 0;
* exclusively output infobox-subbox or infobox, not both
font-size: 0.875rem;
* just replicating the module faithfully
text-align: left;
*/
display: block;
.infobox-subbox {
}
 
/* Table elements */
.infobox tbody {
display: flex;
flex-wrap: wrap;
}
 
.infobox tr {
display: flex;
box-sizing: border-box;
flex-direction: column;
padding: 0 10px;
margin-top: 10px;
}
 
.infobox th,
.infobox td {
padding: 0 5px;
}
 
/* Infobox column */
.infobox .infobox-nocol {
width: 100%;
flex-direction: row;
}
 
.infobox .infobox-nocol th {
width: 30%;
}
 
.infobox .infobox-nocol td {
width: 70%;
}
 
.infobox .infobox-col1 {
width: 100%;
}
 
.infobox .infobox-col2 {
width: 50%;
}
 
.infobox .infobox-col3 {
width: calc( 100% / 3 );
}
 
.infobox .infobox-col4 {
width: 25%;
}
 
.infobox-data {
min-width: 25%;
}
 
/* Infobox image */
.infobox .infobox-image {
overflow: hidden;
padding: 0;
padding: 0;
margin-top: 0;
border: none;
border-radius: var( --border-radius--medium ) var( --border-radius--medium ) 0 0;
margin: -3px;
width: auto;
min-width: 100%;
font-size: 100%;
clear: none;
float: none;
background-color: transparent;
}
}


.infobox-image td {
.infobox-3cols-child {
padding: 0;
margin: auto;
}
}


.infobox-image--light .image {
.infobox .navbar {
background: #eaecf0;
font-size: 100%;
}
}


.infobox-image--dark .image {
/* T281642 */
background: #2b2f36;
body.skin-minerva .infobox-header,
}
body.skin-minerva .infobox-subheader,
 
body.skin-minerva  .infobox-above,
.infobox-image .image:hover img {
body.skin-minerva .infobox-title,
transform: scale( 1.1 );
body.skin-minerva  .infobox-image,
}
body.skin-minerva  .infobox-full-data,
 
body.skin-minerva .infobox-below {
.infobox-image img {
display: block;
max-width: 100%;
background: var( --background-color-quiet--hover );
}
 
/* Neutral background for all transprent SVG */
.infobox-image img[ src$='.svg' ] {
background: #eaecf0;
}
 
/* Infobox title */
.infobox .infobox-title {
width: 100%;
margin-top: 20px;
margin-bottom: 5px;
color: var( --color-base--emphasized );
font-size: var( --font-size-x-large );
    line-height: var( --line-height-xs );
}
 
/* Infobox indicator */
.infobox .infobox-indicator {
margin-top: 0;
padding: 0;
}
 
/* Infobox subtitle */
.infobox .infobox-subtitle {
/* Cancel infobox-title bottom margin */
margin-top: -5px;
margin-bottom: 5px;
}
 
.infobox .infobox-indicator th,
.infobox .infobox-subtitle th {
display: none;
}
 
/* Infobox header */
.infobox .infobox-header {
width: 100%;
padding-top: 15px;
    border-top: 1px solid;
border-color: var( --border-color-base );
margin-top: 15px;
color: var( --color-base--emphasized );
line-height: var( --line-height-xs );
font-size: 1rem;
}
 
/* Infobox value */
.infobox-data th {
color: var( --color-base--subtle );
font-size: 0.8125rem;
font-weight: normal;
letter-spacing: 0.75px;
}
 
.infobox-data td {
font-weight: 600;
}
 
.infobox-data ul,
.infobox-data ol {
margin-top: 0;
}
 
/* Infobox button */
.infobox .infobox-button-bar {
width: 100%;
padding: 0;
margin-top: 25px;
text-align: center;
text-align: center;
}
}


.infobox-button-bar th {
padding: 0;
}
/* Collapsible toggle */
.infobox tr:first-of-type .mw-collapsible-toggle {
position: relative;
display: none;
float: none;
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text {
position: absolute;
right: 0;
display: block;
padding: 5px 15px;
background: var( --color-destructive );
border-radius: 0 var( --border-radius--medium );
color: #fff;
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text:hover {
background: var( --color-destructive--hover );
}
.infobox tr:first-of-type .mw-collapsible-toggle .mw-collapsible-text:active {
background: var( --color-destructive--active );
}
.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text {
background: var( --color-primary );
}
.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text:hover {
background: var( --color-primary--hover );
}


.infobox tr:first-of-type .mw-collapsible-toggle-collapsed .mw-collapsible-text:active {
/* Dark theme: [[William_Wragg]], [[Coral_Castle]] */
background: var( --color-primary--active );
html.skin-theme-clientpref-night .infobox-full-data:not(.notheme) > div:not(.notheme)[style] {
    background: #1f1f23 !important;
      /* switch with var( --color-base ) when supported. */
      color: #f8f9fa;
}
}


.infobox tr:first-of-type .mw-collapsible-toggle:before,
@media (prefers-color-scheme: dark) {
.infobox tr:first-of-type .mw-collapsible-toggle:after {
    html.skin-theme-clientpref-os .infobox-full-data:not(.notheme) div:not(.notheme) {
content: none;
      background: #1f1f23 !important;
      /* switch with var( --color-base ) when supported. */
      color: #f8f9fa;
    }
}
}


@media only screen and ( max-width: 720px ) {
.infobox {
margin-right: auto;
margin-left: auto;
}


.infobox tr:first-of-type .mw-collapsible-toggle {
/* Since infobox is a table, many infobox templates take advantage of this to add columns and rows to the infobox itself rather than as part of a new table inside them. This class should be discouraged and removed on the long term, but allows us to at least identify these tables going forward
display: block;
Currently in use on: [[Module:Infobox3cols]]
}
Fixes issue described in https://phabricator.wikimedia.org/F55300125 on Vector 2022.
*/
@media (min-width: 640px) {
  body.skin--responsive .infobox-table {
    display: table !important;
  }
  body.skin--responsive .infobox-table > caption {
    display: table-caption !important;
  }
  body.skin--responsive .infobox-table > tbody {
    display: table-row-group;
  }
  body.skin--responsive .infobox-table tr {
    display: table-row !important;
  }
  body.skin--responsive .infobox-table th,
  body.skin--responsive .infobox-table td {
    padding-left: inherit;
    padding-right: inherit;
  }
}
}

Revision as of 19:05, 14 June 2024

/* {{pp|small=y}} */
/*
 * This TemplateStyles sheet deliberately does NOT include the full set of
 * infobox styles. We are still working to migrate all of the manual
 * infoboxes. See [[MediaWiki talk:Common.css/to do#Infobox]]
 * DO NOT ADD THEM HERE
 */
/*
 * not strictly certain these styles are necessary since the modules now
 * exclusively output infobox-subbox or infobox, not both
 * just replicating the module faithfully
 */
.infobox-subbox {
	padding: 0;
	border: none;
	margin: -3px;
	width: auto;
	min-width: 100%;
	font-size: 100%;
	clear: none;
	float: none;
	background-color: transparent;
}

.infobox-3cols-child {
	margin: auto;
}

.infobox .navbar {
	font-size: 100%;
}

/* T281642 */
body.skin-minerva .infobox-header,
body.skin-minerva .infobox-subheader,
body.skin-minerva  .infobox-above,
body.skin-minerva .infobox-title,
body.skin-minerva  .infobox-image,
body.skin-minerva  .infobox-full-data,
body.skin-minerva .infobox-below {
	text-align: center;
}


/* Dark theme: [[William_Wragg]], [[Coral_Castle]] */
html.skin-theme-clientpref-night .infobox-full-data:not(.notheme) > div:not(.notheme)[style] {
    background: #1f1f23 !important;
      /* switch with var( --color-base ) when supported. */
      color: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
    html.skin-theme-clientpref-os .infobox-full-data:not(.notheme) div:not(.notheme) {
      background: #1f1f23 !important;
      /* switch with var( --color-base ) when supported. */
      color: #f8f9fa;
    }
}


/* Since infobox is a table, many infobox templates take advantage of this to add columns and rows to the infobox itself rather than as part of a new table inside them. This class should be discouraged and removed on the long term, but allows us to at least identify these tables going forward
Currently in use on: [[Module:Infobox3cols]]
Fixes issue described in https://phabricator.wikimedia.org/F55300125 on Vector 2022.
*/
@media (min-width: 640px) {
  body.skin--responsive .infobox-table {
    display: table !important;
  }
  body.skin--responsive .infobox-table > caption {
    display: table-caption !important;
  }
  body.skin--responsive .infobox-table > tbody {
    display: table-row-group;
  }
  body.skin--responsive .infobox-table tr {
    display: table-row !important;
  }
  body.skin--responsive .infobox-table th,
  body.skin--responsive .infobox-table td {
    padding-left: inherit;
    padding-right: inherit;
  }
}