본문으로 이동

모듈:Sidebar/styles.css

KANOTYPE WIKI
  1 /* {{pp-template}} */
  2 /* TODO: Invert width design to be "mobile first" */
  3 .sidebar {
  4 	/* TODO: Ask if we should have max-width 22em instead */
  5 	width: 22em;
  6 	/* @noflip */
  7 	float: right;
  8 	/* @noflip */
  9 	clear: right;
 10 	/* @noflip */
 11 	margin: 0.5em 0 1em 1em;
 12 	background: var(--background-color-neutral-subtle, #f8f9fa);
 13 	border: 1px solid var(--border-color-base, #a2a9b1);
 14 	padding: 0.2em;
 15 	text-align: center;
 16 	line-height: 1.4em;
 17 	font-size: 88%;
 18 	border-collapse: collapse;
 19 	/* Timeless has display: none on .nomobile at mobile resolutions, so we
 20 	 * unhide it with display: table and let precedence and proximity win.
 21 	 */
 22 	display: table; 
 23 }
 24 
 25 /* Unfortunately, so does Minerva desktop, except Minerva drops an
 26  * !important on the declaration. So we have to be mean for Minerva users.
 27  * Mobile removes the element entirely with `wgMFRemovableClasses` in 
 28  * https://github.com/wikimedia/operations-mediawiki-config/blob/master/
 29  wmf-config/InitialiseSettings.php#L16992
 30  * which is why displaying it categorically with display: table works.
 31  * We don't really want to expose the generic user in the wild on mobile to have
 32  * to deal with sidebars. (Maybe the ones with collapsible lists, so that
 33  * might be an improvement. That is blocked on [[:phab:T111565]].)
 34  */
 35 body.skin-minerva .sidebar {
 36 	display: table !important;
 37 	/* also, minerva is way too aggressive about other stylings on tables.
 38 	 * TODO remove when this template gets moved to a div. plans on talk page.
 39 	 * We always float right on Minerva because that's a lot of extra CSS
 40 	 * otherwise. */
 41     float: right !important;
 42     margin: 0.5em 0 1em 1em !important;
 43 }
 44 
 45 .sidebar-subgroup {
 46 	width: 100%;
 47 	margin: 0;
 48 	border-spacing: 0;
 49 }
 50 
 51 .sidebar-left {
 52 	/* @noflip */
 53 	float: left;
 54 	/* @noflip */
 55 	clear: left;
 56 	/* @noflip */
 57 	margin: 0.5em 1em 1em 0;
 58 }
 59 
 60 .sidebar-none {
 61 	float: none;
 62 	clear: both;
 63 	/* @noflip */
 64 	margin: 0.5em 1em 1em 0;
 65 }
 66 
 67 .sidebar-outer-title {
 68 	padding: 0 0.4em 0.2em;
 69 	font-size: 125%;
 70 	line-height: 1.2em;
 71 	font-weight: bold;
 72 }
 73 
 74 .sidebar-top-image {
 75 	padding: 0.4em;
 76 }
 77 
 78 .sidebar-top-caption,
 79 .sidebar-pretitle-with-top-image,
 80 .sidebar-caption {
 81 	padding: 0.2em 0.4em 0;
 82 	line-height: 1.2em;
 83 }
 84 
 85 .sidebar-pretitle {
 86 	padding: 0.4em 0.4em 0;
 87 	line-height: 1.2em;
 88 }
 89 
 90 .sidebar-title,
 91 .sidebar-title-with-pretitle {
 92 	padding: 0.2em 0.8em;
 93 	font-size: 145%;
 94 	line-height: 1.2em;
 95 }
 96 
 97 .sidebar-title-with-pretitle {
 98 	padding: 0.1em 0.4em;
 99 }
100 
101 .sidebar-image {
102 	padding: 0.2em 0.4em 0.4em;
103 }
104 
105 .sidebar-heading {
106 	padding: 0.1em 0.4em;
107 }
108 
109 .sidebar-content {
110 	padding: 0 0.5em 0.4em;
111 }
112 
113 .sidebar-content-with-subgroup {
114 	padding: 0.1em 0.4em 0.2em;
115 }
116 
117 .sidebar-above,
118 .sidebar-below {
119 	padding: 0.3em 0.8em;
120 	font-weight: bold;
121 }
122 
123 .sidebar-collapse .sidebar-above,
124 .sidebar-collapse .sidebar-below {
125 	border-top: 1px solid #aaa;
126 	border-bottom: 1px solid #aaa;
127 }
128 
129 .sidebar-navbar {
130 	text-align: right;
131 	font-size: 115%;
132 	padding: 0 0.4em 0.4em;
133 }
134 
135 .sidebar-list-title {
136 	padding: 0 0.4em;
137 	text-align: left;
138 	font-weight: bold;
139 	line-height: 1.6em;
140 	font-size: 105%;
141 }
142 
143 /* centered text with mw-collapsible headers is finicky */
144 .sidebar-list-title-c {
145 	padding: 0 0.4em;
146 	text-align: center;
147 	margin: 0 3.3em;
148 }
149 
150 @media (max-width: 640px) {
151 	/* users have wide latitude to set arbitrary width and margin :(
152 	   "Super-specific" selector to prevent overriding this appearance by
153 	   lower level sidebars too */
154 	body.mediawiki .sidebar {
155 		width: 100% !important;
156 		clear: both;
157 		float: none !important; /* Remove when we div based; Minerva is dumb */
158 		margin-left: 0 !important;
159 		margin-right: 0 !important;
160 	}
161 	/* TODO: We might consider making all links wrap at small resolutions and then
162 	 * only introduce nowrap at higher resolutions. Do when we invert the media
163 	 * query.
164 	 */
165 }
166 
167 /* Fixes: T367463 */
168 body.skin--responsive .sidebar a > img {
169 	max-width: none !important;
170 }
171 
172 /* Disable backgrounds via style attribute in night mode Eg.https://phabricator.wikimedia.org/F55243859
173  * https://en.wikipedia.org/w/index.php?title=Laissez-faire
174  */
175 
176 @media screen {
177     html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-list-title,
178     html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle {
179 	  background: transparent !important;
180     }
181 
182     html.skin-theme-clientpref-night .sidebar:not( .notheme ) .sidebar-title-with-pretitle a {
183      	color: var( --color-progressive ) !important;
184     }
185 }
186 
187 @media screen and (prefers-color-scheme: dark) {
188 	html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-list-title,
189 	html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle {
190 		background: transparent !important;
191 	}
192 	
193 	html.skin-theme-clientpref-os .sidebar:not( .notheme ) .sidebar-title-with-pretitle a {
194 		color: var( --color-progressive ) !important;
195 	}
196 }
197 
198 @media print {
199 	body.ns-0 .sidebar {
200 		display: none !important;
201 	}
202 }