Module:InfoboxNeue/styles.css: Difference between revisions
From Amaranth Legacy, available at amaranth-legacy.community
More actions
Content deleted Content added
Tesinormed (talk | contribs) No edit summary |
Tesinormed (talk | contribs) m Protected "Module:InfoboxNeue/styles.css" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading] |
||
| (64 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* original source: https://github.com/The-Star-Citizen-Wikis/SharedModules/blob/a4516d23d28a71502b823b72bb76859c476a1686/InfoboxNeue/styles.css */ |
|||
/* heavily modified for Amaranth Legacy */ |
|||
/* infobox wrapper */ |
/* infobox wrapper */ |
||
.infobox { |
.infobox { |
||
background-color: var(--color-surface-2); |
|||
/* limit the width to 300px */ |
/* limit the width to 300px */ |
||
width: 100%; |
width: 100%; |
||
| Line 6: | Line 10: | ||
/* separate this from the body */ |
/* separate this from the body */ |
||
margin-bottom: var(--space-md); |
margin-bottom: var(--space-md); |
||
/* |
/* small border to separate from content */ |
||
border: 1px solid var(--border-color-base); |
|||
background-color: transparent; |
|||
/* float right */ |
|||
float: right; |
|||
clear: right; |
|||
margin-left: var(--space-lg); |
|||
} |
} |
||
.infobox |
.infobox > summary::-webkit-details-marker { |
||
display: none; |
|||
/* set the background and border when this is open */ |
|||
background-color: var(--color-surface-2); |
|||
border: 1px solid var(--border-color-base); |
|||
} |
} |
||
.infobox__header { |
|||
.infobox__title { |
|||
/* add some padding */ |
/* add some padding */ |
||
padding: |
padding: var(--space-md); |
||
/* set the cursor when hovering to hint to the user */ |
/* set the cursor when hovering to hint to the user */ |
||
cursor: pointer; |
cursor: pointer; |
||
/* don't highlight the text on click */ |
/* don't highlight the text on click */ |
||
user-select: none; |
user-select: none; |
||
/* |
/* display as a flexbox */ |
||
font-size: var(--font-size-xx-large); |
|||
text-align: center; |
|||
white-space: normal; |
|||
/* make this a flexbox */ |
|||
display: flex; |
display: flex; |
||
justify-content: center; |
|||
flex-wrap: nowrap; |
|||
align-items: center; |
align-items: center; |
||
justify-content: center; |
|||
gap: var(--space-md); |
gap: var(--space-md); |
||
} |
} |
||
. |
.infobox__header:hover { |
||
/* change the background color on hover */ |
/* change the background color on hover */ |
||
background-color: var(--background-color-quiet--hover); |
background-color: var(--background-color-button-quiet--hover); |
||
} |
|||
.infobox__title { |
|||
/* typography */ |
|||
font-size: var(--font-size-xx-large); |
|||
font-family: var(--font-family-header-custom, var(--font-family-base)); |
|||
text-align: center; |
|||
} |
|||
.infobox__content { |
|||
/* fix box-sizing */ |
|||
box-sizing: border-box; |
|||
} |
} |
||
/* lines around the titles */ |
/* lines around the titles */ |
||
. |
.infobox__header::before, |
||
. |
.infobox__header::after, |
||
.infobox__sectionTitle::before, |
.infobox__sectionTitle::before, |
||
.infobox__sectionTitle::after { |
.infobox__sectionTitle::after { |
||
content: ""; |
content: ""; |
||
height: 1px; |
height: 1px; |
||
background: var(--color-emphasized); |
|||
flex: 1 0 1rem; |
|||
} |
|||
background: var(--color-base--emphasized); |
|||
align-self: center; |
|||
.infobox__header::before, |
|||
.infobox__header::after { |
|||
flex: 1 0 var(--space-lg); |
|||
} |
} |
||
| Line 55: | Line 71: | ||
.infobox__sectionTitle { |
.infobox__sectionTitle { |
||
/* make this clearly a title */ |
/* make this clearly a title */ |
||
color: var(--color |
color: var(--color-emphasized); |
||
font-weight: bold; |
font-weight: bold; |
||
} |
|||
.infobox__image { |
|||
/* center broken file links */ |
|||
text-align: center; |
|||
} |
} |
||
| Line 71: | Line 92: | ||
} |
} |
||
/* semi-functional gallery support */ |
|||
.infobox__image + .infobox__section { |
|||
.infobox__gallery .gallery.mw-gallery-traditional { |
|||
/* margin between image and first section */ |
|||
/* make this semi-functional */ |
|||
margin-top: var(--space-md); |
|||
display: grid; |
|||
} |
|||
grid-template-columns: minmax(0, 1fr); |
|||
grid-template-rows: minmax(0, 1fr); |
|||
margin: 0 !important; |
|||
} |
|||
.infobox__gallery .gallerybox { |
|||
width: 100% !important; |
|||
height: auto !important; |
|||
} |
|||
.infobox__gallery .gallerybox .thumb { |
|||
width: 100% !important; |
|||
height: auto !important; |
|||
place-content: center; |
|||
} |
|||
.infobox__gallery .gallerybox .thumb img { |
|||
display: inline-block; |
|||
width: 100%; |
|||
height: auto; |
|||
object-fit: contain; |
|||
} |
|||
.infobox__gallery .gallerytext { |
|||
text-align: center; |
|||
} |
|||
.infobox__caption { |
.infobox__caption { |
||
| Line 83: | Line 130: | ||
font-size: var(--font-size-small); |
font-size: var(--font-size-small); |
||
font-weight: normal; |
font-weight: normal; |
||
line-height: var(--line-height- |
line-height: var(--line-height-xx-small); |
||
text-align: center; |
text-align: center; |
||
/* center this horizontally */ |
/* center this horizontally */ |
||
| Line 92: | Line 139: | ||
.infobox__section { |
.infobox__section { |
||
/* pad horizontally */ |
/* pad horizontally */ |
||
padding- |
padding-inline: var(--space-md); |
||
padding-right: var(--space-md); |
|||
} |
} |
||
.infobox__content > * + * { |
|||
.infobox__section + .infobox__section { |
|||
/* margin between sections */ |
/* margin between sections */ |
||
margin-top: var(--space-md); |
margin-top: var(--space-md); |
||
} |
} |
||
. |
.infobox > .infobox__content > :last-child { |
||
/* don't bottom out at the last section */ |
/* don't bottom out at the last section */ |
||
margin-bottom: 0; |
margin-bottom: 0; |
||
| Line 113: | Line 159: | ||
/* separate from the items */ |
/* separate from the items */ |
||
margin-bottom: var(--space-xxs); |
margin-bottom: var(--space-xxs); |
||
/* make this a |
/* make this a grid */ |
||
display: |
display: grid; |
||
grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr); |
|||
flex-wrap: nowrap; |
|||
align-items: center; |
align-items: center; |
||
gap: var(--space-sm); |
|||
justify-content: center; |
|||
gap: var(--space-md); |
|||
/* only shrink */ |
|||
flex: 0 1 auto; |
|||
} |
} |
||
| Line 129: | Line 172: | ||
/* section item labels */ |
/* section item labels */ |
||
.infobox__section .infobox__item .infobox__label { |
.infobox__section .infobox__item > .infobox__label { |
||
color: var(--color |
color: var(--color-subtle); |
||
font-size: var(--font-size-small); |
font-size: var(--font-size-small); |
||
line-height: var(--line-height- |
line-height: var(--line-height-xx-small); |
||
} |
} |
||
/* section item content */ |
/* section item content */ |
||
.infobox__section .infobox__item .infobox__content { |
.infobox__section .infobox__item > .infobox__content { |
||
font-size: var(--font-size-small); |
font-size: var(--font-size-small); |
||
line-height: var(--line-height- |
line-height: var(--line-height-medium); |
||
} |
} |
||
.infobox__section .infobox__item > .infobox__content .mw-collapsible-toggle { |
|||
/* fix section content newline handling */ |
|||
float: none; |
|||
.infobox__section .infobox__item > .infobox__content { |
|||
white-space: break-spaces; |
|||
} |
} |
||
/* fix section content overflow */ |
/* fix section content overflow */ |
||
.infobox__section .infobox__item > .infobox__content > * { |
.infobox__section .infobox__item > .infobox__content > * { |
||
display: inline-block; |
|||
word-break: break-word; |
word-break: break-word; |
||
margin-block: 0; |
margin-block: 0; |
||
| Line 154: | Line 195: | ||
/* fix section content lists */ |
/* fix section content lists */ |
||
.infobox__section .infobox__item > .infobox__content |
.infobox__section .infobox__item > .infobox__content ul, |
||
.infobox__section .infobox__item > .infobox__content ol, |
|||
white-space: normal; |
|||
.infobox__section .infobox__item > .infobox__content dl { |
|||
margin-inline: var(--space-sm) 0; |
|||
margin-block: 0; |
|||
} |
} |
||
/* on phones, center the infobox */ |
/* on phones, center the infobox */ |
||
@media |
@media screen and (max-width: 639px) { |
||
.infobox { |
.infobox { |
||
float: none; |
|||
clear: none; |
|||
margin-inline: auto; |
|||
} |
} |
||
} |
} |
||
Latest revision as of 10:44, September 11, 2025
/* original source: https://github.com/The-Star-Citizen-Wikis/SharedModules/blob/a4516d23d28a71502b823b72bb76859c476a1686/InfoboxNeue/styles.css */
/* heavily modified for Amaranth Legacy */
/* infobox wrapper */
.infobox {
background-color: var(--color-surface-2);
/* limit the width to 300px */
width: 100%;
max-width: 300px;
/* separate this from the body */
margin-bottom: var(--space-md);
/* small border to separate from content */
border: 1px solid var(--border-color-base);
/* float right */
float: right;
clear: right;
margin-left: var(--space-lg);
}
.infobox > summary::-webkit-details-marker {
display: none;
}
.infobox__header {
/* add some padding */
padding: var(--space-md);
/* set the cursor when hovering to hint to the user */
cursor: pointer;
/* don't highlight the text on click */
user-select: none;
/* display as a flexbox */
display: flex;
justify-content: center;
align-items: center;
gap: var(--space-md);
}
.infobox__header:hover {
/* change the background color on hover */
background-color: var(--background-color-button-quiet--hover);
}
.infobox__title {
/* typography */
font-size: var(--font-size-xx-large);
font-family: var(--font-family-header-custom, var(--font-family-base));
text-align: center;
}
.infobox__content {
/* fix box-sizing */
box-sizing: border-box;
}
/* lines around the titles */
.infobox__header::before,
.infobox__header::after,
.infobox__sectionTitle::before,
.infobox__sectionTitle::after {
content: "";
height: 1px;
background: var(--color-emphasized);
}
.infobox__header::before,
.infobox__header::after {
flex: 1 0 var(--space-lg);
}
.infobox__title,
.infobox__sectionTitle {
/* make this clearly a title */
color: var(--color-emphasized);
font-weight: bold;
}
.infobox__image {
/* center broken file links */
text-align: center;
}
.infobox__image img {
/* prevent overflowing */
object-fit: contain;
width: 100%;
height: auto;
}
.infobox__image img[src$=".svg"] {
/* background color for transparent SVGs */
background: #eaecf0;
}
/* semi-functional gallery support */
.infobox__gallery .gallery.mw-gallery-traditional {
/* make this semi-functional */
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-rows: minmax(0, 1fr);
margin: 0 !important;
}
.infobox__gallery .gallerybox {
width: 100% !important;
height: auto !important;
}
.infobox__gallery .gallerybox .thumb {
width: 100% !important;
height: auto !important;
place-content: center;
}
.infobox__gallery .gallerybox .thumb img {
display: inline-block;
width: 100%;
height: auto;
object-fit: contain;
}
.infobox__gallery .gallerytext {
text-align: center;
}
.infobox__caption {
/* pad this */
padding-top: var(--space-md);
/* typography */
color: var(--color-subtle);
font-size: var(--font-size-small);
font-weight: normal;
line-height: var(--line-height-xx-small);
text-align: center;
/* center this horizontally */
margin: 0 auto;
}
.infobox__caption,
.infobox__section {
/* pad horizontally */
padding-inline: var(--space-md);
}
.infobox__content > * + * {
/* margin between sections */
margin-top: var(--space-md);
}
.infobox > .infobox__content > :last-child {
/* don't bottom out at the last section */
margin-bottom: 0;
padding-bottom: var(--space-md);
}
.infobox__sectionTitle {
/* typography */
font-size: var(--font-size-large);
text-align: center;
/* separate from the items */
margin-bottom: var(--space-xxs);
/* make this a grid */
display: grid;
grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
align-items: center;
gap: var(--space-sm);
}
.infobox__sectionContent {
display: grid;
gap: var(--space-sm);
}
/* section item labels */
.infobox__section .infobox__item > .infobox__label {
color: var(--color-subtle);
font-size: var(--font-size-small);
line-height: var(--line-height-xx-small);
}
/* section item content */
.infobox__section .infobox__item > .infobox__content {
font-size: var(--font-size-small);
line-height: var(--line-height-medium);
}
.infobox__section .infobox__item > .infobox__content .mw-collapsible-toggle {
float: none;
}
/* fix section content overflow */
.infobox__section .infobox__item > .infobox__content > * {
word-break: break-word;
margin-block: 0;
}
/* fix section content lists */
.infobox__section .infobox__item > .infobox__content ul,
.infobox__section .infobox__item > .infobox__content ol,
.infobox__section .infobox__item > .infobox__content dl {
margin-inline: var(--space-sm) 0;
margin-block: 0;
}
/* on phones, center the infobox */
@media screen and (max-width: 639px) {
.infobox {
float: none;
clear: none;
margin-inline: auto;
}
}
/* CSS grid utility classes */
.infobox__grid--row {
grid-auto-flow: column;
}
.infobox__grid--cols-1 {
grid-template-columns: minmax(0, 1fr);
}
.infobox__grid--cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.infobox__grid--cols-3 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.infobox__grid--cols-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
.infobox__grid--cols-5 {
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.infobox__grid--cols-6 {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
.infobox__grid--col-span-2 {
grid-column: span 2;
}
.infobox__grid--col-span-3 {
grid-column: span 3;
}
.infobox__grid--col-span-4 {
grid-column: span 4;
}
.infobox__grid--col-span-5 {
grid-column: span 5;
}
.infobox__grid--col-span-6 {
grid-column: span 6;
}
.infobox__grid--space-between {
justify-content: space-between;
}