Page MenuHomePhabricator

Format to exclude element from desktop view
Closed, DeclinedPublic

Description

Author: ian2

Description:
It would be nice to have a class/ID that ensures that elements are not diplayed on desktop views, and consequently are displayed on mobile views.
Extension:MobileFrontend

Extension:MobileFrontend supports the class element "nomobile" which means that it won't show on on a mobile or tablet. See https://www.mediawiki.org/wiki/Extension:MobileFrontend#Configuring_the_main_page

A corresponding class/id would be "nodesktop".


Version: unspecified
Severity: enhancement

Details

Reference
bz73427

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:58 AM
bzimport set Reference to bz73427.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for taking the time to report this!

What would be the usecase of this? Any examples?

ian2 wrote:

Because my mobile is a different size and shape to my desktop, I want to put images on certain pages at different sizes for mobiles and desktops. eg.

<div class="nomobile">[[file:headerimageDesktop.jpg|1024px]]</div>
<div class="nodesktop">[[file:headerimageMobile.jpg|420px]]</div>

I could also use it for display information in different ways for mobiles and desktops, eg.

<div class="nomobile">Click the menu left</div>

<div class="nodesktop">Click the ≡ button top left</div>

Aklapper triaged this task as Lowest priority.Mar 23 2015, 5:01 PM
Izno subscribed.

I'm boldly declining. We have TemplateStyles now for this case.

MobileFrontend's nomobile does more than just 'not display' stuff: it actively removes the content before it goes down the pipe. I do not think that is a use case worth supporting on desktop in the same way.

That said, the proposed use case can also be solved directly with TemplateStyles.