Hide element/object only on server?

Is it possible to only hide an element or object only on the server or “touch tablet/screen” side, but keep it visible in the host editor?

My specific reasoning is for my script widgets. So I can easily edit them without having to remember to hide them every time I’m done editing.

Using css media queries might do the trick if your host screen size is different from the tablet’s:

@media screen and (max-width: 1200px) {

    :host {

        /* hide the widget if the window is smaller than 1200px */
       display:none;

    }

}

This might even work better, although I didn’t test it:

@media (pointer: coarse) {

    :host {

        /* hide the widget if the device is touch-capable */
       display:none;

    }

}

You could put all of them in the same container/tab, that’d help too.

1 Like