Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
You must create an account or log in to edit.

Module:InfoboxNeue/styles.css: Difference between revisions

From Amaranth Legacy, available at amaranth-legacy.community
Content deleted Content added
No edit summary
m Protected "Module:InfoboxNeue/styles.css" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading]
 
(80 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 {
.infobox {
margin-bottom: var(--space-md);
background-color: var(--color-surface-2);
/* limit the width to 300px */
width: 100%;
width: 100%;
max-width: 300px;
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);
border: 1px solid var(--border-color-base);
/* float right */
background-color: transparent;
float: right;
font-size: var(--font-size-small);
clear: right;
line-height: var(--line-height-sm);
margin-left: var(--space-lg);
box-sizing: content-box;
}
}


.infobox[open] {
.infobox > summary::-webkit-details-marker {
display: none;
background-color: var(--color-surface-2);
}
}


.infobox__header {
.infobox > summary {
/* add some padding */
list-style-type: none;
padding: var(--space-md);
}
/* set the cursor when hovering to hint to the user */

cursor: pointer;
.infobox__content {
/* don't highlight the text on click */
position: relative;
user-select: none;
}
/* display as a flexbox */

.infobox__image {
position: relative;
}

.infobox__image img {
/* Prevent overflow */
max-width: 100%;
height: auto;
}

/* Provide background color for transparent SVGs */
.infobox__image img[src$=".svg"] {
background: #eaecf0;
}

.infobox__image-upload {
position: absolute;
bottom: var(--space-md);
left: 0;
right: 0;
z-index: 1;
}

.infobox__image-upload > a {
display: flex;
display: flex;
margin: var(--space-md);
padding: var(--space-xs) var(--space-sm);
border-radius: var(--border-radius--small);
background: var(--color-surface-3);
color: var(--color-base--emphasized);
font-weight: var(--font-weight-medium);
text-decoration: none;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
gap: var(--space-xs);
gap: var(--space-md);
}
}


.infobox__header:hover {
.infobox__image-upload > a .citizen-ui-icon {
/* change the background color on hover */
width: 1rem;
background-color: var(--background-color-button-quiet--hover);
height: 1rem;
}
}


.infobox__title {
.infobox__image-upload > a:hover {
/* typography */
background: var(--color-surface-2--hover);
font-size: var(--font-size-xx-large);
font-family: var(--font-family-header-custom, var(--font-family-base));
text-align: center;
}
}


.infobox__content {
.infobox__image-upload > a:active {
/* fix box-sizing */
background: var(--color-surface-2--active);
box-sizing: border-box;
}
}


/* lines around the titles */
.infobox__snippet,
.infobox__header,
.infobox__header::before,
.infobox__header::after,
.infobox__sectionHeader,
.infobox__sectionTitle::before,
.infobox__sectionContent {
.infobox__sectionTitle::after {
padding-left: var(--space-md);
content: "";
padding-right: var(--space-md);
height: 1px;
background: var(--color-emphasized);
}
}


.infobox__header::before,
.infobox__snippet {
.infobox__header::after {
position: relative;
flex: 1 0 var(--space-lg);
z-index: 1;
padding-top: var(--space-sm);
padding-bottom: var(--space-sm);
background-color: var(--color-surface-2);
display: flex;
gap: var(--space-xs);
align-items: center;
white-space: nowrap;
cursor: pointer;
/* So that clicking the infobox summary won't highlight the text */
user-select: none;
}
}


.infobox__title,
.infobox__snippet:hover {
.infobox__sectionTitle {
background-color: var(--background-color-quiet--hover);
/* make this clearly a title */
color: var(--color-emphasized);
font-weight: bold;
}
}


.infobox__image {
/* Might as well steal from skin */
/* center broken file links */
.infobox__snippet .mw-ui-icon-wikimedia-collapse {
--transform-rotate-collapse: rotate3d(1, 0, 0, 180deg);
--size-icon: var(--font-size-small);
width: var(--font-size-small);
height: var(--font-size-small);
flex-shrink: 0;
transition: var(--transition-hover);
transition-property: transform;
transform: var(--transform-rotate-collapse);
}

.infobox[open] .infobox__snippet .mw-ui-icon-wikimedia-collapse {
transform: none;
}

.infobox__snippet .infobox__desc {
max-width: 100%;
text-overflow: ellipsis;
overflow: hidden;
font-size: var(--font-size-small);
}

.infobox__indicators {
display: flex;
padding: var(--space-xs);
gap: var(--space-xxs);
}

.infobox__indicator {
padding: var(--space-xxs) var(--space-xs);
background: var(--color-surface-2);
color: var(--color-base);
border-radius: var(--border-radius--small);
line-height: var(--line-height-xs);
margin: 0 auto;
}

.infobox__indicator .infobox__data {
font-size: var(--font-size-x-small);
font-weight: var(--font-weight-normal);
letter-spacing: 0.025em;
text-align: center;
text-align: center;
}
}


.infobox__image img {
/* TODO: Add support for multiple badges */
/* prevent overflowing */
.infobox__indicator.infobox__indicator--nopadding {
object-fit: contain;
padding: 0;
width: 100%;
height: auto;
}
}


.infobox__image img[src$=".svg"] {
.infobox__indicator.infobox__indicator--red {
background-color: var(--background-color-destructive-subtle);
/* background color for transparent SVGs */
background: #eaecf0;
color: var(--color-destructive);
}
}


/* semi-functional gallery support */
.infobox__indicator.infobox__indicator--yellow {
.infobox__gallery .gallery.mw-gallery-traditional {
background-color: var(--background-color-warning-subtle);
/* make this semi-functional */
color: var(--color-warning);
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-rows: minmax(0, 1fr);
margin: 0 !important;
}
}


.infobox__gallery .gallerybox {
.infobox__indicator.infobox__indicator--green {
width: 100% !important;
background-color: var(--background-color-success-subtle);
height: auto !important;
color: var(--color-success);
}
}


.infobox__gallery .gallerybox .thumb {
.infobox__header,
width: 100% !important;
.infobox__sectionHeader {
line-height: var(--line-height-xs);
height: auto !important;
place-content: center;
}
}


.infobox__gallery .gallerybox .thumb img {
.infobox__header {
display: inline-block;
margin-bottom: var(--space-lg);
display: flex;
width: 100%;
height: auto;
gap: var(--space-sm);
object-fit: contain;
}
}


.infobox__gallery .gallerytext {
.infobox__snippet {
justify-content: center;
text-align: center;
text-align: center;
}
}


.infobox__caption {
.infobox__snippet .infobox__desc {
/* pad this */
padding-top: var(--space-md);
/* typography */
/* typography */
color: var(--color-base--emphasized);
color: var(--color-subtle);
font-size: var(--font-size-xx-large);
font-size: var(--font-size-small);
font-weight: bold;
font-weight: normal;
line-height: var(--line-height-xx-small);
white-space: normal;
text-align: center;
/* make this a flexbox */
/* center this horizontally */
display: flex;
flex-wrap: nowrap;
margin: 0 auto;
align-items: center;
justify-content: center;
gap: var(--space-md);
/* only grow */
flex: 1 0 auto;
}
}


.infobox__caption,
/* lines around the header */
.infobox__section {
.infobox__snippet .infobox__desc::before,
/* pad horizontally */
.infobox__snippet .infobox__desc::after {
padding-inline: var(--space-md);
content: "";
height: 1px;
flex: 1 0 2rem;
background: var(--color-base--emphasized);
align-self: center;
}
}


.infobox__content > * + * {
.infobox__snippet .infobox__desc::before {
margin-right: var(--space-md);
/* margin between sections */
}

.infobox__snippet .infobox__desc::after {
margin-left: var(--space-md);
}

.infobox__section,
.infobox__sectionHeader,
.infobox__sectionContent {
margin-top: var(--space-md);
margin-top: var(--space-md);
}
}


.infobox > .infobox__content > :last-child {
.infobox__title,
/* don't bottom out at the last section */
.infobox__sectionTitle {
color: var(--color-base--emphasized);
font-weight: var(--font-weight-semibold);
}

.infobox__title {
font-size: var(--font-size-x-large);
}

.infobox__sectionSubtitle {
margin-top: 2px;
}

.infobox__section + .infobox__section {
margin-top: var(--space-xl);
}

/* Use padding to prevent margin collapse when there is no footer */
.infobox__content > .infobox__section:last-child {
margin-bottom: 0;
margin-bottom: 0;
padding-bottom: var(--space-md);
padding-bottom: var(--space-md);
}

.infobox__sectionTitle {
font-size: var(--font-size-medium);
display: flex;
align-items: center;
gap: var(--space-md);
}
}


.infobox__sectionTitle {
.infobox__sectionTitle {
/* typography */
/* typography */
font-size: var(--font-size-large);
text-align: center;
text-align: center;
/* make this a flexbox */
/* separate from the items */
margin-bottom: var(--space-xxs);
display: flex;
/* make this a grid */
flex-wrap: nowrap;
display: grid;
grid-template-columns: minmax(1rem, 1fr) auto minmax(1rem, 1fr);
align-items: center;
align-items: center;
gap: var(--space-sm);
justify-content: center;
gap: var(--space-md);
/* only shrink */
flex: 0 1 auto;
}

.infobox__sectionTitle::before,
.infobox__sectionTitle::after {
content: "";
height: 1px;
flex: 1 0 2rem;
background: var(--color-base--emphasized);
align-self: center;
}

.infobox__sectionSubtitle {
color: var(--color-base--subtle);
}
}


Line 282: Line 171:
}
}


/* fix section newline handling */
/* section item labels */
.infobox__section .infobox__item > .infobox__data {
.infobox__section .infobox__item > .infobox__label {
color: var(--color-subtle);
white-space: break-spaces;
font-size: var(--font-size-small);
}
line-height: var(--line-height-xx-small);

/* fix text overflow */
.infobox__section .infobox__item > .infobox__data > * {
display: inline-block;
word-break: break-word;
margin-block: 0;
}

.infobox__item {
display: grid;
gap: 2px var(--space-xs);
grid-auto-rows: max-content;
}

.infobox__item--hasIcon {
display: flex;
align-items: center;
column-gap: var(--space-sm);
}

.infobox__badge {
place-content: center;
text-align: center;
box-shadow: inset 0 0 0 1px var(--border-color-base);
border-radius: var(--border-radius--medium);
padding: var(--space-xs) var(--space-sm);
font-weight: var(--font-weight-medium);
background-color: var(--color-surface-1);
}

.infobox__desc,
.infobox__label {
color: var(--color-base--subtle);
font-size: var(--font-size-x-small);
}

.infobox__label {
letter-spacing: 0.05em;
}
}


/* section item content */
.infobox__grid--row .infobox__label,
.infobox__section .infobox__item > .infobox__content {
.infobox__grid--row .infobox__desc {
font-size: var(--font-size-small);
font-size: var(--font-size-small);
line-height: var(--line-height-medium);
}
}


.infobox__section .infobox__item > .infobox__content .mw-collapsible-toggle {
.infobox__data {
float: none;
font-weight: var(--font-weight-medium);
}
}


/* fix section content overflow */
.infobox__icon img {
.infobox__section .infobox__item > .infobox__content > * {
filter: var(--filter-invert);
word-break: break-word;
opacity: var(--opacity-icon-base);
margin-block: 0;
}
}


/* fix section content lists */
.infobox__itemButton {
.infobox__section .infobox__item > .infobox__content ul,
position: relative;
.infobox__section .infobox__item > .infobox__content ol,
padding: var(--space-sm) var(--space-md);
.infobox__section .infobox__item > .infobox__content dl {
line-height: var(--line-height-sm);
margin-inline: var(--space-sm) 0;
gap: 0;
margin-block: 0;
}
}


/* on phones, center the infobox */
.infobox__itemButton:hover {
@media screen and (max-width: 639px) {
background-color: var(--background-color-quiet--hover);
}

.infobox__itemButton:hover .infobox__itemButtonArrow {
transform: rotate(90deg) translateY(-4px);
}

.infobox__itemButton:active {
background-color: var(--background-color-quiet--active);
}

.infobox__itemButton .infobox__text {
flex-grow: 1;
}

.infobox__itemButton .infobox__data {
color: var(--color-base--emphasized);
}

.infobox__itemButtonLink a {
position: absolute;
inset: 0;
opacity: 0;
}

.infobox__itemButton .infobox__icon {
margin-right: var(--space-sm);
}

.infobox__itemButton .infobox__icon img {
width: 1.25rem;
height: 1.25rem;
}

.infobox__itemButtonArrow {
width: 1rem;
height: 1rem;
transition: var(--transition-hover);
transform: rotate(90deg);
}

.infobox__footer {
margin-top: var(--space-lg);
border-top: 1px solid var(--border-color-base);
background-color: var(--color-surface-1);
border-bottom-left-radius: var(--border-radius--medium);
border-bottom-right-radius: var(--border-radius--medium);
}

.infobox__footer > .infobox__section {
margin: 0;
padding: var(--space-md);
display: grid;
gap: var(--space-xxs);
}

.infobox__button {
position: relative;
border-bottom-left-radius: var(--border-radius--medium);
border-bottom-right-radius: var(--border-radius--medium);
padding: var(--space-sm) var(--space-md);
background-color: var(--color-primary);
cursor: pointer;
}

.infobox__button:hover {
background-color: var(--color-primary--hover);
}

.infobox__buttonLabel {
display: flex;
justify-content: center;
align-items: center;
gap: var(--space-xs);
color: #fff;
font-weight: var(--font-weight-medium);
}

/* Fake button with link element */
.infobox__buttonLink {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

.infobox__buttonLink a {
display: block;
height: 100%;
font-size: 0;
}

.infobox__buttonCard {
position: absolute;
top: 100%;
left: 0;
right: 0;
z-index: -1;
border: 1px solid var(--border-color-base);
background-color: var(--color-surface-1);
border-radius: var(--border-radius--medium);
box-shadow: var(--box-shadow-dialog);
opacity: 0;
transition: var(--transition-menu);
transition-property: opacity, transform;
visibility: hidden;
transform: translateY(-20px);
}

.infobox__button:hover > .infobox__buttonCard {
z-index: 10;
opacity: 1;
visibility: visible;
transform: none;
cursor: auto;
}

.infobox__linkButton a {
padding: var(--space-xxs) var(--space-xs);
display: block;
border-radius: var(--border-radius--small);
text-decoration: none !important;
}

/* Hide external URL icon */
.infobox__linkButton a:after {
content: none;
}

.infobox__linkButton a:hover {
background-color: var(--background-color-quiet--hover);
}

.infobox__linkButton a:active {
background-color: var(--background-color-quiet--active);
}

.infobox__section--linkButtons > .infobox__sectionContent {
margin-bottom: var(--space-md);
}

.infobox__section--linkButtons .infobox__data {
margin-top: var(--space-xxs);
/* negative space-xs */
margin-left: -8px;
/* negative space-xs */
margin-right: -8px;
display: flex;
flex-wrap: wrap;
align-items: baseline;
}

.infobox__buttonLabel img[src$=".svg"] {
filter: invert(1);
}

@media only screen and (max-width: 639px) {
.infobox {
.infobox {
margin-right: auto;
float: none;
margin-left: auto;
clear: none;
margin-inline: auto;
}
}
}

.infobox__section--actions .infobox__sectionContent {
padding-left: 0;
padding-right: 0;
}

/* TODO: Remove when footer is removed */
.infobox__section--hasBackground + .infobox__section--hasBackground,
.infobox__section--hasBackground + .infobox__footer {
margin-top: 0;
}

.infobox__section--hasBackground .infobox__sectionContent {
margin: 0;
}

.infobox__section--metadata .infobox__sectionContent {
padding: var(--space-md);
background: var(--color-surface-1);
line-height: var(--line-height-xs);
gap: var(--space-xxs);
}

.infobox__section--metadata .infobox__label,
.infobox__section--metadata .infobox__data {
font-size: var(--font-size-x-small);
}

.infobox__section--metadata .infobox__data {
word-break: break-word;
font-family: var(--font-family-monospace);
}
}


Line 595: Line 262:
.infobox__grid--space-between {
.infobox__grid--space-between {
justify-content: space-between;
justify-content: space-between;
}

/* FloatingUI styles */
.infobox__indicator--nopadding .ext-floatingui-reference {
padding: var(--space-xxs) var(--space-xs);
}

/* Tabber styles */
.infobox__section--tabber > .infobox__sectionHeader {
margin-bottom: var(--space-xxs);
}

.infobox__section--tabber > .infobox__sectionContent {
padding-left: 0;
padding-right: 0;
}

/* Spacing is handled by tabber */
.infobox__section--tabber .infobox__sectionContent {
margin-top: 0;
margin-bottom: 0;
}

.infobox__section--tabber .tabber .infobox__section {
margin-top: var(--space-sm);
margin-bottom: 0;
}

/* Increase top margin for nested tabber section */
.infobox__section--tabber .infobox__section.infobox__section--tabber {
margin-top: var(--space-xl);
}

.infobox__section--tabber .tabber__header {
margin-left: var(--space-xs);
margin-right: var(--space-xs);
box-shadow: none;
}

/* Match padding in the rest of the infobox */
.infobox__section--tabber .tabber__tab {
margin-left: var(--space-xs);
margin-right: var(--space-xs);
padding-left: 0;
padding-right: 0;
}
}

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;
}