Page MenuHomePhabricator

When printing jquery.makeCollapsible collapsed elements should be expanded
Open, Needs TriagePublic


When printing, collapsible elements should be expanded in print output.

It is because the "user" of the paper cannot expand them by himself. They should be already expanded.

It can be done with @media CSS styles.

Event Timeline

Can you please provide an example what a "collapsible element" is, or some link to a page where this problem can be reproduced?
Also, which project is this about? Is this about MediaWiki core, or some extension?

Please see for future tasks. Thanks!

Legoktm added a subscriber: Legoktm.

Probably referring to jquery.collapsible.

I refer to collapsible elements.

Print "[Collapse]" button in the first example and then do Print or Print Preview.

Elements collapsed on the scree should not be collapsed in print;

TheDJ renamed this task from Print collapsible elements expanded to When printing jquery.makeCollapsible collapsed elements should be expanded.Jun 15 2017, 12:04 PM

I have added the following snippet to

.mw-parser-output .mw-collapsed .mw-collapsible-content {
	display: block !important;

This could be added to our stylesheets.

Does this CSS snippet actually work? The hidden elements on are not expanded in print preview.

Also I have added this snippet to my private wiki (1.27.3), then created a page with the following:

<div class="toccolours mw-collapsible mw-collapsed">
This text is not collapsible; but the next is collapsible and hidden by default:
<div class="mw-collapsible-content">Lorem ipsum dolor sit amet...</div>

and the hidden text remained hidden in the print preview.

@johnnybaloney Apologies, you are absolutely correct. The full snippet should have been:

.mw-parser-output .mw-collapsed .mw-collapsible-content {
	display: block !important;
.mw-parser-output > * > tr {
	display: table-row !important;
.mw-parser-output > li,
.mw-parser-output > li {
	display: list-item !important;

I've update English Wikipedia for this now.

Great, thanks! In my 1.27.3 instance I had to drop .mw-parser-output as no such class seem to be in use. I also added hiding of span.toctoggle for the TOC [hide] element.

Change 370945 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/core@master] mw-collapsible: Add print styles to uncollapse content

The toggle button is useless on paper and should hidden on the print version.

For the collapsible content it may be useful to allow hiding on print version by selecting the wanted state of the toggle buttons and then start printing.

It may be useful to add two additional CSS classes for the authors for overriding the normal behavior for the print version:




where it may be useful for the content.

@Fomafix in general, that's just wasteful. We have classes for people to manipulate how coordinates display. About 50 people use that, of which only 10 or so are still active. It's totally useless.

Then let the readers decide if something is on the printable version or not and keep the current behavior.

Change 370945 abandoned by TheDJ:
mw-collapsible: Add print styles to uncollapse content