Is there any mobile variable that can be use in the templates?

I want to use a mobile variable to show different segments of the code depending on the user’s device. For example:

{{#if mobile}}you are on mobile{{else}}you are on desktop{{/fi}}

I know I could use js to do it… But I believe if there is server variable like this it will be way better to render the view straight from the backend, than leaving it to the user.

It might be simpler to change what content is visible based on screen size.

e.g.

<style>
  .only-wide,
  .only-narrow {
    display: none;
  }

  @media (min-width: 750px) {
    .only-wide {
      display: block;
    }
  }

  @media (max-width: 750px) {
    .only-narrow {
      display: block;
    }
  }
</style>
<div class="only-wide">
  You are on a wide device
</div>
<div class="only-narrow">
  You are on a narrow device
</div>