diff --git a/core/modules/system/templates/menu.html.twig b/core/modules/system/templates/menu.html.twig
index 03704f2..4e7ed79 100644
--- a/core/modules/system/templates/menu.html.twig
+++ b/core/modules/system/templates/menu.html.twig
@@ -29,6 +29,10 @@
 {{ menus.menu_links(items, attributes, 0) }}
 
 {% macro menu_links(items, attributes, menu_level) %}
+  {#
+    This macro can only access the variables passed to it as parameters. All
+    other variables available to the template cannot be used inside the macro.
+  #}
   {% import _self as menus %}
   {% if items %}
     {% if menu_level == 0 %}
diff --git a/core/themes/classy/templates/navigation/menu.html.twig b/core/themes/classy/templates/navigation/menu.html.twig
index e482ef4..2ad3834 100644
--- a/core/themes/classy/templates/navigation/menu.html.twig
+++ b/core/themes/classy/templates/navigation/menu.html.twig
@@ -27,6 +27,10 @@
 {{ menus.menu_links(items, attributes, 0) }}
 
 {% macro menu_links(items, attributes, menu_level) %}
+  {#
+    This macro can only access the variables passed to it as parameters. All
+    other variables available to the template cannot be used inside the macro.
+  #}
   {% import _self as menus %}
   {% if items %}
     {% if menu_level == 0 %}
diff --git a/core/themes/stable/templates/navigation/menu.html.twig b/core/themes/stable/templates/navigation/menu.html.twig
index 33efca8..4758709 100644
--- a/core/themes/stable/templates/navigation/menu.html.twig
+++ b/core/themes/stable/templates/navigation/menu.html.twig
@@ -27,6 +27,10 @@
 {{ menus.menu_links(items, attributes, 0) }}
 
 {% macro menu_links(items, attributes, menu_level) %}
+  {#
+    This macro can only access the variables passed to it as parameters. All
+    other variables available to the template cannot be used inside the macro.
+  #}
   {% import _self as menus %}
   {% if items %}
     {% if menu_level == 0 %}
