How do I get the current path and add a condition in page.html.twig? I have the view page called "location/all" which contain all the map details.

I changed some CSS styles.

&lt;!--&lt;div role="main" class="main-container {{ container }} js-quickedit-main-content"&gt;!--&gt;
{% if 'location/all' in url %}
  &lt;div role="main" class="main-container js-quickedit-main-content"&gt;
{% else %}
 &lt;div role="main" class="main-container {{ container }} js-quickedit-main-content"&gt;
{% endif %}


I tried this code to check the condition, but every time it executes the else part.
Try this 

{% if 'location/all' in url('&lt;current&gt;')|render|render %}


Alternative solution would be to add the following to your THEMENAME.theme 

function THEMENAME_preprocess_page(&amp;$vars) {
  $vars['path'] = \Drupal::service('path.current')-&gt;getPath();
}


and use this in your page.html.twig

{% if 'location/all' in path %}