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) No edit summary |
||
| Line 91: | Line 91: | ||
.infobox__gallery .gallerybox .thumb { |
.infobox__gallery .gallerybox .thumb { |
||
width: 100% !important; |
width: 100% !important; |
||
} |
|||
.infobox__gallery .gallerybox .thumb { |
|||
place-content: space-between; |
|||
} |
} |
||
Revision as of 21:06, December 31, 2024
/* 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);
}
.infobox[open] {
/* set the border when this is open */
border: 1px solid var(--border-color-base);
}
.infobox__title {
/* add some padding */
padding: var(--space-sm) 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;
/* typography */
font-size: var(--font-size-xx-large);
text-align: center;
white-space: normal;
/* make this a grid */
display: grid;
grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
align-items: center;
grid-gap: var(--space-sm);
}
.infobox__title:hover {
/* change the background color on hover */
background-color: var(--background-color-quiet--hover);
}
/* lines around the titles */
.infobox__title::before,
.infobox__title::after,
.infobox__sectionTitle::before,
.infobox__sectionTitle::after {
content: "";
height: 1px;
background: var(--color-base--emphasized);
}
.infobox__title,
.infobox__sectionTitle {
/* make this clearly a title */
color: var(--color-base--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;
}
.infobox__image + .infobox__section {
/* margin between image and first section */
margin-top: var(--space-md);
}
/* 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,
.infobox__gallery .gallerybox .thumb {
width: 100% !important;
}
.infobox__gallery .gallerybox .thumb {
place-content: space-between;
}
.infobox__gallery .gallerybox .thumb img {
width: 100%;
height: auto;
object-fit: contain;
}
.infobox__gallery .gallerytext {
text-align: center;
}
.infobox__image + .infobox__image,
.infobox__gallery + .infobox__image,
.infobox__image + .infobox__gallery {
/* margin between image / gallery and the next one */
margin-top: var(--space-md);
}
.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-sm);
text-align: center;
/* center this horizontally */
margin: 0 auto;
}
.infobox__caption,
.infobox__section {
/* pad horizontally */
padding-left: var(--space-md);
padding-right: var(--space-md);
}
.infobox__section + .infobox__section {
/* margin between sections */
margin-top: var(--space-md);
}
.infobox__content > .infobox__section: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;
grid-gap: var(--space-sm);
}
.infobox__sectionContent {
display: grid;
gap: var(--space-sm);
}
/* section item labels */
.infobox__section .infobox__item .infobox__label {
color: var(--color-base--subtle);
font-size: var(--font-size-small);
line-height: var(--line-height-sm);
}
/* section item content */
.infobox__section .infobox__item .infobox__content {
font-size: var(--font-size-small);
line-height: var(--line-height-md);
}
/* fix section content newline handling */
.infobox__section .infobox__item > .infobox__content {
white-space: break-spaces;
}
/* fix section content overflow */
.infobox__section .infobox__item > .infobox__content > * {
display: inline-block;
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 {
white-space: normal;
}
/* on phones, center the infobox */
@media only screen and (max-width: 639px) {
.infobox {
margin-right: auto;
margin-left: 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;
}