I am using {% if teaser %} .... {% endif %} To change structure of content type according to its view mode.
But it looks like I cannot check for custom view modes created using Drupal 8, Such as:
{% if medium_teaser %}
<div id="product-teaser">
{{ content.field_image }}
<a class="buy-now-btn" href="{{ path('entity.node.canonical', {'node':
node.id}) }}">Buy now</a>
</div>
{% endif %}
Is there a way to check for custom view modes in twig templates?