Jump to content

Module:Navbox/div/styles.css: Difference between revisions

From WikipediNyah
Created page with ".navbox-div { box-sizing: border-box; border: 1px solid #a2a9b1; clear: both; font-size: 88%; padding: 3px; margin: 1em auto 0; Prevent preceding content from clinging to navboxes: } .navbox-div .navbox-div { margin-top: 0; No top margin for nested navboxes: } .navbox-div + .navbox-div-styles + .navbox-div { margin-top: -1px; Single pixel border between adjacent navboxes: } .navbox-div-title { font-size: 114%; } .navbox-div .mw-collapsible-tog..."
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
Line 1: Line 1:
.navbox-div {
.navbox-div {
box-sizing: border-box;
box-sizing: border-box;
border: 1px solid #a2a9b1;
border: 1px solid var(--border-color-base, #a2a9b1);
clear: both;
clear: both;
font-size: 88%;
font-size: 88%;
Line 29: Line 29:
padding: 0.25em 1em;
padding: 0.25em 1em;
line-height: 1.5em;
line-height: 1.5em;
text-align: center;
}
}


.navbox-div-group,
.navbox-div-group,
.navbox-div-title,
.navbox-div-title {
.navbox-div-subgroup {
font-weight: bold;
font-weight: bold;
}
}
 
.navbox-div,
.navbox-div-lists {
.navbox-div-subgroup {
display: grid;
background-color: #fdfdfd;
gap: 2px;
}
}


.navbox-div-list {
.navbox-div-list {
line-height: 1.5em;
line-height: 1.5em;
border-color: #fdfdfd; /* Must match background color */
padding: 0 0.25em
padding: 0 0.25em
}
}


/* cell spacing for navbox cells */
.navbox-div-abovebelow:not(.navbox-div-below),
/* Borders above 2nd, 3rd, etc. rows */
.navbox-div-main {
.navbox-div-abovebelow,
margin: 2px 0;
.navbox-div-image,
.navbox-div-leftimage,
.navbox-div-lists > div {
border-top: 2px solid #fdfdfd; /* Must match background color */
margin-top: 2px;
}
 
.navbox-div-abovebelow:first-child,
.navbox-div-image:first-child,
.navbox-div-leftimage:first-child,
.navbox-div-lists > div:first-child {
border-top: none;
}
}


.navbox-div-image,
.navbox-div-image,
.navbox-div-leftimage {
.navbox-div-leftimage,
.navbox-div-list-groupless {
text-align: center;
text-align: center;
}
}


 
.navbox-div .mw-collapsible-content .hlist dl,
.navbox-div-title-and-bar {
.navbox-div .mw-collapsible-content .hlist ol,
background-color: #ccf; /* Level 1 color */
.navbox-div .mw-collapsible-content .hlist ul {
}
 
.navbox-div-abovebelow,
.navbox-div-group,
.navbox-div-subgroup .navbox-div-title-and-bar {
background-color: #ddf; /* Level 2 color */
}
 
.navbox-div-subgroup .navbox-div-group,
.navbox-div-subgroup .navbox-div-abovebelow {
background-color: #e6e6ff; /* Level 3 color */
}
 
.navbox-div-even {
background-color: #f7f7f7;
}
 
.navbox-div-odd {
background-color: transparent;
}
 
.navbox-div .hlist dl,
.navbox-div .hlist ol,
.navbox-div .hlist ul {
padding: 0.125em 0;
padding: 0.125em 0;
}
}
Line 103: Line 65:
.navbox-div .navbar {
.navbox-div .navbar {
font-size: 100%;
font-size: 100%;
display: block;
/* @noflip */
float: left;
/* @noflip */
/* @noflip */
text-align: left;
margin-right: 0.5em;
}
 
@media screen {
.navbox-div,
.navbox-div-subgroup {
background-color: #fdfdfd; /* hsl(0, 0%, 99.22%) */
}
.navbox-div-title-and-bar {
background-color: #ccf; /* Level 1 color hsl(240, 100%, 90%) */
}
.navbox-div-abovebelow,
.navbox-div-group,
.navbox-div-subgroup .navbox-div-title-and-bar {
background-color: #ddf; /* Level 2 color hsl(240, 100%, 93.33%) */
}
.navbox-div-subgroup .navbox-div-group,
.navbox-div-subgroup .navbox-div-abovebelow {
background-color: #e6e6ff; /* Level 3 color hsl(240, 100%, 95.1%) */
}
.navbox-div-even {
background-color: #f7f7f7; /* hsl(0, 0%, 96.86%) */
}
/*
.navbox-div-odd {
background-color: transparent;
}
*/
/* the dark greys used in this template are flips of their colors above with
* an offset from the standard dark background
* which is #202122 hsl(210, 3.03%, 12.94%) with rounding hsl(210, 3%, 13%)
* e.g. normally .navbox-div is hsl(0, 0%, 99%)
* flip is hsl(0, 0%, 1%)
* then add the 1% to #202122 to get hsl(210, 3%, 14%)
* ... I know it's rough
*/
html.skin-theme-clientpref-night .navbox-div,
html.skin-theme-clientpref-night .navbox-div-subgroup {
background-color: hsl(210, 3%, 14%);
}
html.skin-theme-clientpref-night .navbox-div-title-and-bar {
background-color: hsl(240, 100%, 10%); /* Level 1 color */
}
html.skin-theme-clientpref-night .navbox-div-abovebelow,
html.skin-theme-clientpref-night .navbox-div-group,
html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-title-and-bar {
background-color: hsl(240, 100%, 7%); /* Level 2 color */
}
html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-group,
html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-abovebelow {
background-color: hsl(240, 100%, 5%); /* Level 3 color */
}
html.skin-theme-clientpref-night .navbox-div-even {
background-color: hsl(210, 3%, 16%);
}
/*
html.skin-theme-clientpref-night .navbox-div-odd {
background-color: transparent;
}
*/
}
}


Line 119: Line 154:
white-space: nowrap;
white-space: nowrap;
justify-content: flex-end;
justify-content: flex-end;
}
/* why are these two separate rules now?) */
.navbox-div .navbar {
display: block;
/* @noflip */
float: left;
/* @noflip */
margin-right: 0.5em;
}
}


.navbox-div-list-with-group {
.navbox-div-list-with-group {
text-align: left;
text-align: left;
border-left-width: 2px;
}
border-left-style: solid;
/* in case the group wraps with <br> or wrap setting, we can't rely on flex-end */
.navbox-div-group {
text-align: right;
}
}
Line 143: Line 172:
.navbox-div-leftimage {
.navbox-div-leftimage {
align-self: center;
align-self: center;
}
.navbox-div-image {
padding-left: 2px;
}
.navbox-div-leftimage {
padding-right: 2px;
}
}
.navbox-div-lists {
.navbox-div-lists {
display: grid;
grid-template-columns: auto 1fr;
grid-template-columns: auto 1fr;
flex: 1;
flex: 1;
Line 162: Line 198:
}
}
.navbox-div-subgroup {
flex: 1;
margin: 0 -0.25em; /* match padding of lists above */
}
.navbox-div-subgroup .navbox-div-list-groupless {
justify-content: flex-start;
}
}
}

Latest revision as of 10:45, 29 December 2024

.navbox-div {
	box-sizing: border-box;
	border: 1px solid var(--border-color-base, #a2a9b1);
	clear: both;
	font-size: 88%;
	padding: 3px;
	margin: 1em auto 0; /* Prevent preceding content from clinging to navboxes */
}

.navbox-div .navbox-div {
	margin-top: 0; /* No top margin for nested navboxes */
}

.navbox-div + .navbox-div-styles + .navbox-div {
	margin-top: -1px; /* Single pixel border between adjacent navboxes */
}

.navbox-div-title {
	font-size: 114%;
}

.navbox-div .mw-collapsible-toggle {
	padding-right: 1em;
}

.navbox-div-group,
.navbox-div-title-and-bar,
.navbox-div-abovebelow {
	padding: 0.25em 1em;
	line-height: 1.5em;
}

.navbox-div-group,
.navbox-div-title {
	font-weight: bold;
}
	
.navbox-div-lists {
	display: grid;
	gap: 2px;
}

.navbox-div-list {
	line-height: 1.5em;
	padding: 0 0.25em
}

.navbox-div-abovebelow:not(.navbox-div-below),
.navbox-div-main {
	margin: 2px 0;
}

.navbox-div-image,
.navbox-div-leftimage,
.navbox-div-list-groupless {
	text-align: center;
}

.navbox-div .mw-collapsible-content .hlist dl,
.navbox-div .mw-collapsible-content .hlist ol,
.navbox-div .mw-collapsible-content .hlist ul {
	padding: 0.125em 0;
}

.navbox-div .navbar {
	font-size: 100%;
	display: block;
	/* @noflip */
	float: left;
	/* @noflip */
	margin-right: 0.5em;
}

@media screen {
	.navbox-div,
	.navbox-div-subgroup {
		background-color: #fdfdfd; /* hsl(0, 0%, 99.22%) */
	}
	
	.navbox-div-title-and-bar {
		background-color: #ccf; /* Level 1 color hsl(240, 100%, 90%) */
	}
	
	.navbox-div-abovebelow,
	.navbox-div-group,
	.navbox-div-subgroup .navbox-div-title-and-bar {
		background-color: #ddf; /* Level 2 color hsl(240, 100%, 93.33%) */
	}
	
	.navbox-div-subgroup .navbox-div-group,
	.navbox-div-subgroup .navbox-div-abovebelow {
		background-color: #e6e6ff; /* Level 3 color hsl(240, 100%, 95.1%) */
	}
	
	.navbox-div-even {
		background-color: #f7f7f7; /* hsl(0, 0%, 96.86%) */
	}
	
	/*
	.navbox-div-odd {
		background-color: transparent;
	}
	*/
	
	/* the dark greys used in this template are flips of their colors above with
	 * an offset from the standard dark background
	 * which is #202122 hsl(210, 3.03%, 12.94%) with rounding hsl(210, 3%, 13%)
	 * e.g. normally .navbox-div is hsl(0, 0%, 99%)
	 * flip is hsl(0, 0%, 1%)
	 * then add the 1% to #202122 to get hsl(210, 3%, 14%)
	 * ... I know it's rough
	 */
	html.skin-theme-clientpref-night .navbox-div,
	html.skin-theme-clientpref-night .navbox-div-subgroup {
		background-color: hsl(210, 3%, 14%);
	}
	
	html.skin-theme-clientpref-night .navbox-div-title-and-bar {
		background-color: hsl(240, 100%, 10%); /* Level 1 color */
	}
	
	html.skin-theme-clientpref-night .navbox-div-abovebelow,
	html.skin-theme-clientpref-night .navbox-div-group,
	html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-title-and-bar {
		background-color: hsl(240, 100%, 7%); /* Level 2 color */
	}
	
	html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-group,
	html.skin-theme-clientpref-night .navbox-div-subgroup .navbox-div-abovebelow {
		background-color: hsl(240, 100%, 5%); /* Level 3 color */
	}
	
	html.skin-theme-clientpref-night .navbox-div-even {
		background-color: hsl(210, 3%, 16%);
	}
	
	/*
	html.skin-theme-clientpref-night .navbox-div-odd {
		background-color: transparent;
	}
	*/
}

@media (min-width: 720px) {
	.navbox-div {
		text-align: center;
	}

	.navbox-div.mw-collapsible .navbox-div-title {
		margin: 0 4em;
	}

	.navbox-div-group {
		white-space: nowrap;
		justify-content: flex-end;
	}

	.navbox-div-list-with-group {
		text-align: left;
	}
	
	/* in case the group wraps with <br> or wrap setting, we can't rely on flex-end */
	.navbox-div-group {
		text-align: right;
	}
	
	.navbox-div-main {
		display: flex;
	}
	
	.navbox-div-image,
	.navbox-div-leftimage {
		align-self: center;
	}
	
	.navbox-div-image {
		padding-left: 2px;
	}
	
	.navbox-div-leftimage {
		padding-right: 2px;
	}
	
	.navbox-div-lists {
		grid-template-columns: auto 1fr;
		flex: 1;
		align-items: stretch;
	}
	
	.navbox-div-list-groupless {
		grid-column: 1/3;
		justify-content: center;
	}
	
	.navbox-div-lists > div {
		display: flex;
		align-items: center;
	}
	
	.navbox-div-subgroup {
		flex: 1;
		margin: 0 -0.25em; /* match padding of lists above */
	}
	
	.navbox-div-subgroup .navbox-div-list-groupless {
		justify-content: flex-start;
	}
}